Reference · built on requestCommons signalEconomic & calendar reference

ONS API

UK labour market, prices, GDP, and population datasets from the Office for National Statistics, through an open JSON API.

About

The ONS API is the Office for National Statistics' programmatic route to its published datasets, served from api.beta.ons.gov.uk/v1. Each dataset has editions, each edition has versions, and each version breaks down by dimensions such as time, geography, and aggregate. Datasets include CPIH (cpih01), the UK Labour Market, the GDP monthly estimate, the Retail sales index, ASHE earnings tables, regional GDP, and mid-year population estimates. The API is open: no key, no account.

On Fibric, an operator reads the series that price your labour, rent, or sales and proposes a budget, price-list, or benchmark change for your approval.

This is a reference listing. It documents what Fibric would read from ONS API and what it could propose, based on the publisher's published interfaces. Fibric builds it under a managed deployment when you request it; selecting it here installs nothing.

Inputs

  • /datasets and /datasets/{id}: every published dataset with its title, release_frequency, and next_release
  • /datasets/{id}/editions/{edition}/versions/{version}: one version's dimensions, options, and metadata
  • /datasets/{id}/editions/{edition}/versions/{version}/observations with one option per dimension, or a single * wildcard
  • Filters: POST /filters, PUT /filters/{id}/dimensions/{name}/options, then /filter-outputs/{filter_output_id} for download links
  • Search, topic, dimension search, code list, and hierarchy endpoints for finding datasets and valid codes
  • Series such as cpih01, labour-market, gdp-to-four-decimal-places, retail-sales-index, mid-year-pop-est, and the ASHE tables

Proposed actions

Read-only. This feed informs operators; it changes nothing.

Proposed actions are target capabilities. Every action runs propose-first and needs a validated deployment and the appropriate permissions.

What you can build

  • Index a wage budget to CPIH and earnings

    Each month the operator reads the new cpih01 version and the relevant ASHE table, applies them to your labour budget assumptions, and proposes the revised figure for the finance lead.

    With Labor Budget

  • Move prices with the CPIH release

    When a new CPIH version lands, the operator compares your list prices with the index movement since the last review and proposes which lines to change, with the release date attached.

    With Price List Drift

  • Benchmark sites against regional GDP and retail sales

    Pull regional-gdp-by-quarter and retail-sales-index for the regions where you trade. The operator lays your own site figures beside them in the quarterly pack.

    With Site Benchmark, Board Pack

Requirements

  • A User-Agent of the form botName/Version1.0.0 (organisation-name contact@organisation.com +http://www.organisation-site.com/bot.html)
  • Request pacing under 120 requests per 10 seconds and 200 per minute across all site and API assets
  • Handling of 429 Too Many Requests with the Retry-After header; ignoring it can bring a block of up to 1 hour
  • The dataset id, edition, and version for each series, and the time label rather than the id for the time dimension
Authentication
None. ONS says the API is open and unrestricted with no API keys. Send a User-Agent naming your bot, version, organisation, and a contact address, as the ONS bot guide asks.

Limits

  • ONS labels the API Beta and warns that breaking changes may occur
  • A wildcard observations query returns at most 10,000 observations; larger cuts go through the filter workflow
  • Rate limits are 120 requests per 10 seconds, 200 per minute, and 15 per 10 seconds on high-demand assets; ONS may change them without notice
  • Some datasets list next_release as TBC or To be announced, so you cannot always schedule a pull ahead of time

Access and pricing

Reference listing. Public feed access is separate from Fibric integration. If you request this feed, your quote covers the build, usage, and support.

Request ONS API ↗

Questions and answers

Does the ONS API need a key?
No. ONS states the API is open and unrestricted with no API keys required. ONS does ask bots to send an identifying User-Agent with a contact address and to respect the Retry-After header on 429 responses.
What are the rate limits?
ONS publishes 120 requests per 10 seconds and 200 requests per minute for all site and API assets, and 15 per 10 seconds for high-demand assets. Over the limit you get 429 Too Many Requests with Retry-After. ONS may change these without notice.
What licence covers the data?
ONS says all content is available under the Open Government Licence v3.0 except where otherwise stated. Individual datasets in the API carry a license field; cpih01 and mid-year-pop-est list Open Government Licence v3.0.
Ask about ONS API

Ask about the capabilities and requirements in this listing.

For project-specific requirements, contact Fibric.