ONS API Converter

How to use

This tool converts between the legacy ONS API format and the new beta API format. You can:

API Endpoint

Example API calls:

Documentation

The tool can be used programmatically with the following endpoints:

Parameters:

Vega Example

Here's an example of how to create a Vega chart using the ONS API data with our CORS proxy:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": "https://eco-cors-proxy.netlify.app/proxy?url=" + 
          "https://economicsobservatory.github.io/api/ons.html" + 
          "?code=l55o&format=json&data_only=true",
    "format": {
      "type": "json", 
      "property": "months"
    }
  },
  "mark": "line",
  "encoding": {
    "x": {"field": "date", "type": "temporal"},
    "y": {"field": "value", "type": "quantitative"}
  }
}

Live Example (GDP Quarter on Quarter Growth):

Limitations