Created
October 28, 2018 11:54
-
-
Save Abbe98/19a06618a042d1c7f41a574d8a3e6e0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchJson = async (url) => await (await fetch(url, { headers: new Headers({ 'Accept': 'application/json' }) })).json(); | |
const sochQuery = async (query) => { | |
const json = await fetchJson(`http://www.kulturarvsdata.se/ksamsok/api?x-api=test&method=search&query=geoDataExists=n%20AND%20thumbnailExists=j%20AND%20itemType=foto&recordSchema=xml&fields=itemDescription,itemLabel,thumbnail,byline,copyright,mediaLicense&startRecord=10000`); | |
return json.result.records.record.map(r => r['field']); | |
} | |
console.log(sochQuery('')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment