Published
Edited
Nov 24, 2021
Fork of Fetch
Importers
Insert cell
Insert cell
viewof url = text({
placeholder: 'type url and click fetch',
description: 'enter data url to fetch',
value: urlString,
submit: 'fetch'})
Insert cell
Insert cell
urlString = 'https://opendata-ajuntament.barcelona.cat/data/api/action/datastore_search_sql?sql=SELECT%20*%20from%20%22f627ac0a-d05f-416d-9773-eeb464a3fc44%22%20WHERE%20%22Nom_Indicador%22%20LIKE%20%27Casos%20de%20COVID-19%20a%20Barcelona%20(diari)%27'
Insert cell
url2 = "https://opendata-ajuntament.barcelona.cat/data/api/action/datastore_search?resource_id=a3992af4-5eef-477b-9062-c230fdd02c53&limit=5"
Insert cell
Insert cell
dataJson = fetch(proxy + url, {
headers: {
Accept: '*/*',
'Accept-Language': 'en-US,en;q=0.5',
Referer: 'https://observablehq.com/@randomfractals/fetch',
},
//credentials: 'include',
cache: 'no-store',
mode: 'cors',
redirect: 'follow',
}).then(response => {
if (!response.ok) throw new Error(response.status);
return response.json();
}).catch(error => {return error;})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more