This service provides a CORS proxy for accessing the Economics Observatory and ONS APIs (and it should work for others too, though untested). It enables cross-origin requests for applications that need to access these data sources.
To use the proxy, prefix your target URL with our proxy endpoint:
https://eco-cors-proxy.netlify.app/proxy?url=YOUR_TARGET_URL
https://eco-cors-proxy.netlify.app/proxy?url=https://api.ons.gov.uk/timeseries/d7g7/dataset/mm23/data
https://eco-cors-proxy.netlify.app/proxy?url=https://api.beta.ons.gov.uk/v1/data?uri=/economy/inflationandpriceindices/timeseries/d7g7/mm23
https://eco-cors-proxy.netlify.app/proxy?url=https://api.beta.ons.gov.uk/v1/data?uri=/economy/inflationandpriceindices/timeseries/l55o/mm23
https://eco-cors-proxy.netlify.app/proxy?url=https://api.beta.ons.gov.uk/v1/data?uri=/employmentandlabourmarket/peoplenotinwork/unemployment/timeseries/mgsx/lms
https://eco-cors-proxy.netlify.app/proxy?url=https://economicsobservatory.github.io/api/ons.html?code=mgsx&format=json&data_only=true
https://eco-cors-proxy.netlify.app/proxy?url=https://api.coindesk.com/v1/bpi/currentprice.json
Note: Data provided by CoinDesk's Bitcoin Price Index. Updates every minute with current BTC prices in USD, GBP, and EUR.
https://eco-cors-proxy.netlify.app/proxy?url=https://api.coinbase.com/v2/exchange-rates?currency=USD
Note: Returns current exchange rates for USD against all supported fiat currencies and cryptocurrencies on Coinbase. Updates frequently throughout the day.
https://eco-cors-proxy.netlify.app/proxy?url=https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_API_KEY&file_type=json
Note: Replace YOUR_API_KEY with your actual FRED API key. The proxy handles URL encoding automatically!
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://eco-cors-proxy.netlify.app/proxy?url=https://api.coindesk.com/v1/bpi/currentprice.json",
"format": {
"type": "json",
"property": "bpi.USD.rate_float"
}
},
"mark": "bar",
"encoding": {
"y": {"field": "data", "type": "quantitative", "title": "Bitcoin Price (USD)"}
}
}
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": "US GDP Over Time",
"width": "container",
"height": 300,
"data": {
"url": "https://eco-cors-proxy.netlify.app/proxy?url=https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_API_KEY&file_type=json",
"format": {
"type": "json",
"property": "observations"
}
},
"mark": {
"type": "line",
"color": "#36B7B4"
},
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"title": "Date"
},
"y": {
"field": "value",
"type": "quantitative",
"title": "GDP (Billions of Dollars)"
}
}
}
You can use these specifications in the Vega Editor. Note that:
The proxy returns JSON responses with appropriate CORS headers. For Economics Observatory API Converter responses, the proxy will try extract and parse the JSON data from the HTML response, and fall back onto proxying the ONS beta API as a a backup.
400 - Missing target URL parameter405 - Method not allowed (only GET requests are supported)429 - Too many requests (rate limit exceeded)500 - Server error