# FXMacroData vs ONS API: UK CPI, GDP and Labour Data for GBP Traders

Canonical: https://fxmacrodata.com/articles/fxmacrodata-vs-ons-api
Author: FXMacroData
Published: 2026-10-05T12:00:00Z

A buyer-guide comparison of the free ONS beta API and time series JSON with FXMacroData for GBP/USD traders and developers: access, 07:00 release timing, rate limits, dataset freshness, licence, and cross-currency FX workflow fit.

This comparison is for[GBP/USD](/dashboard/GBP_USD) traders, quant developers, and analysts who need UK macro data in code and are deciding between the Office for National Statistics (ONS) and FXMacroData. The ONS is the publisher of record for UK CPI[inflation](/indicators/inflation) ,[GDP](/indicators/gdp) , and the[labour market](/articles/labor-statistics-fx-trading) statistics that feed straight into[Bank of England](/dashboard/press-releases/gbp) pricing. It offers two programmatic routes: the beta ONS API at`api.beta.ons.gov.uk`, documented on the ONS Developer Hub, and the long-standing time series JSON endpoints on`ons.gov.uk`. Both are free and need no API key.

The core finding: the ONS wins on authority, cost, and statistical depth; FXMacroData wins when the job is release-timed sterling trading. The ONS publishes market-sensitive releases at 07:00 UK time, but its time series JSON carries a date-level release stamp, the beta API is still marked as subject to breaking changes, and some of its CPI datasets lag the website. FXMacroData reads the same official UK releases and stores each one as a row with a second-level`announcement_datetime`, in the same schema as[USD](/united-states) ,[EUR](/eurozone) ,[JPY](/japan) , and 18 other currencies, with a release calendar, FX rates, and AI/MCP access around it.

**Decision snapshot**

**Choose the ONS when**

You need official UK statistics with full component, regional, and seasonal-adjustment detail, long history, revisions, and free reuse under the Open Government Licence.

**Choose FXMacroData when**

You trade or model[GBP](/united-kingdom) crosses around the 07:00 releases and need second-level release timestamps, one schema across 22 currencies, a calendar, and REST, SSE, or MCP access.

**Quick answer**

The ONS is the free source of record for UK data. FXMacroData is the release-aware FX layer on top: Always Free for USD, $50/month Individual for GBP and every other currency.

**Takeaway:**many sterling desks use both: the ONS for official depth and citations, FXMacroData for timed, multi-currency release workflows.

## Pricing and access

The ONS is not a commercial vendor. The Developer Hub introduction describes the API as open and unrestricted, with no API keys required, so you can call it from a script or a browser straight away. The time series endpoints on the main website work the same way: append`/data`to a series page and you get JSON. ONS content is published under the Open Government Licence v3.0 unless otherwise stated.

FXMacroData publishes self-serve pricing. The Always Free tier needs no key and covers USD data only, at 100 requests/day, with USD announcements delayed 15 minutes. The Individual plan is $50/month or $500/year with a 14-day trial, and it unlocks GBP plus the other 21 currencies, with 1,000,000 requests/month and bursts of 300/minute. Business is $250/month or $2,500/year for companies and teams of up to 10 people. Enterprise is by custom agreement, and a self-serve Commercial Redistribution add-on costs $10/month per block of up to 100 measured users (or 1,000 public-feed followers).

**What it costs to get UK macro data into code**

**ONS API and time series**

**Free, no key***

Beta API (datasets, observations, filters, search) plus time series JSON on ons.gov.uk. Shared rate limits apply.

**FXMacroData Always Free**

**$0**

No key, USD data only, 100 requests/day, USD announcements delayed 15 minutes. Useful for testing the schema.

**FXMacroData Individual**

**$50/month**

GBP and 21 other currencies, 14-day trial, 1,000,000 requests/month, calendar, FX, COT, yields, and MCP.

**Takeaway:**on price the ONS cannot be beaten. The FXMacroData fee pays for release timing, cross-currency normalisation, and the FX tooling around the numbers, not for the UK statistics themselves.

** Competitor pricing retrieved from the ONS Developer Hub introduction page in October 2026. No paid tier or API key requirement is described there.*

## Side-by-side comparison

Attribute ONS (beta API and time series JSON) FXMacroData Core job Official dissemination of UK statistics: bulletins, datasets, time series, census, and search. FX macro data layer: release rows, calendar, FX rates, COT, yields, dashboards, and AI access. Entry pricing Free*$0 (USD only) or $50/month Individual for all 22 currencies Free tier Everything is free; no API key required*Always Free: USD only, 100 requests/day, 15-minute delay on USD announcements Coverage UK only, with deep detail: CPI and CPIH components, GDP by output, labour market, trade, public finances, census; 338 datasets listed in the beta API 22 currencies including GBP, USD, EUR, JPY,[CHF](/switzerland) ,[AUD](/australia) ,[CAD](/canada) ; 700+ indicator series Release timing / latency Market-sensitive releases at 07:00 UK time; time series JSON carries a date-level`releaseDate`; some beta API datasets lag the website Second-level`announcement_datetime`on every row; typically available within seconds of official publication, measured publicly at[/release-speed](/release-speed) API format JSON (beta API observations and time series), CSV/XLSX via filter jobs, CSV via the website generator REST JSON with OpenAPI, SSE streaming, GraphQL, Python/JS SDKs Rate limits 120 requests per 10 seconds and 200 per minute across site and API; 15 per 10 seconds on high-demand assets; 429 with`Retry-After`, blocks of up to 1 hour if ignored 1,000,000 requests/month on paid plans; bursts 300/min, 5,000/hour, 20 concurrent History Long official history, e.g. CPI annual rate monthly from 1989, with revision context in bulletins Release history with announcement timestamps and prior values for point-in-time backtests AI / MCP None official; developers build their own adapters Official[MCP server](/mcp) for Claude, ChatGPT, Cursor, and other clients Licence for programmatic / commercial use Open Government Licence v3.0 unless otherwise stated: commercial and non-commercial reuse with attribution Personal/internal use on Individual; company use on Business; redistribution via the self-serve add-on Best fit Official UK research, warehouses, component and regional depth Release-timed GBP trading, cross-currency models, agents

** Competitor pricing retrieved from the ONS Developer Hub introduction page in October 2026. The ONS publishes no paid API tier.*

## What the ONS actually gives you in code

There are two distinct routes, and FX developers usually end up using both. The first is the beta API at`https://api.beta.ons.gov.uk/v1`. It exposes datasets, editions, and versions; an observations service that returns JSON for one option per dimension with a single wildcard; a filter service that accepts any dimension combination by POST and returns CSV or XLSX; plus search, topic, code-list, and Census 2021 services. When checked in October 2026 it listed 338 datasets, a large share of them Census 2021 tables, alongside economic sets such as`cpih01`,`gdp-to-four-decimal-places`,`labour-market`,`retail-sales-index`, and`trade`.

The second route is the time series JSON on the main website. Every ONS series has a four-character ID within a source dataset; UK CPI annual inflation is`D7G7`in the`MM23`consumer price dataset. Adding`/data`to the series page returns the full history:

```
curl "https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/d7g7/mm23/data"
```

The response holds a`description`block (title, unit,`releaseDate`,`nextRelease`) and separate`years`,`quarters`, and`months`arrays of string values, each with an`updateDate`. It is simple to parse, and for headline UK series it is current: the August 2026 CPI print was in the series the day it was published. GDP quarter-on-quarter growth (`IHYQ`in`QNA`) and the unemployment rate (`MGSX`in`LMS`) work the same way.

**Beta API status, October 2026**

**Still beta**

The Developer Hub says the API is in beta and that there may occasionally be breaking changes.

**Retired routes**

The older v0 API (`/dataset/{id}/timeseries/...`) and several page-level data endpoints are on the retirement list. Time series and dataset pages are not affected.

**Dataset freshness varies**

The`cpih01`dataset's latest version was released on 18 February 2026 and ends at January 2026, while the website already showed August 2026 CPI.

**Takeaway:**for headline UK prints, the time series JSON is the dependable ONS route; check each beta API dataset's latest version before you build on it.

## Release timing: the 07:00 slot and what the JSON shows

The ONS release calendar is the reference point for every sterling trader. The release page for "Consumer price inflation, UK: September 2026" lists a release date of 21 October 2026 at 7:00am, and "GDP monthly estimate, UK: August 2026" lists 15 October 2026 at 7:00am. The unemployment rate series shows its next release as 20 October 2026. That is an hour before the London FX open gets busy, and GBP/USD often reprices in the first seconds.

The August 2026 CPI release shows what the time series JSON records. The bulletin went out on 16 September 2026; in the`D7G7`JSON,`releaseDate`reads`2026-09-15T23:00:00.000Z`, which is midnight UK time on the release day, not 07:00. The same date-level convention appears on each observation's`updateDate`. That is fine for a monthly chart. For an event study, you need the actual publication moment, which means watching the release yourself and recording when the new value appeared.

**UK CPI for August 2026, released 16 September 2026**

**Scheduled**

The ONS release calendar lists the CPI bulletin for 07:00. FXMacroData mirrors it in`/v1/calendar/gbp`.

**07:00 BST (06:00 UTC)**

ONS bulletin: CPI rose 3.1% in the 12 months to August 2026, up from 2.9% in July.

**ONS time series JSON**

`releaseDate`2026-09-15T23:00Z, i.e. the release day at midnight UK time. No time of day.

**FXMacroData row**

A release row with`val`,`previous_value`, and a second-level`announcement_datetime`, pushed over SSE and readable via REST or MCP.

**Takeaway:**the ONS tells you which day the number was released; FXMacroData records the second it was published, so the print can be joined to GBP/USD ticks without rebuilding the timeline.

FXMacroData's timing claim is narrow and measurable: releases are typically available within seconds of official publication, against a target of one second from publication, and the measured record, by source, is published at[/release-speed](/release-speed) , including every release that took longer. It is a measured target, not a guarantee. Note also that the ONS rate limits tighten on high-demand assets, and the Developer Hub says block durations change dynamically around release schedules, so a homemade poller that hammers the site at 07:00 is exactly the client those limits are designed to slow down.

## The data itself: UK CPI inflation from the ONS

The numbers are the same official statistics whichever route you take. The chart plots the UK[CPI annual rate](/api-data-docs/gbp/inflation) for the twelve months to August 2026, as served by the ONS time series endpoint for`D7G7`. This is the series that most directly shapes market pricing of the[Bank Rate](/api-data-docs/gbp/policy_rate) path.

**UK CPI, annual rate (%)**

September 2025 to August 2026. Hover a point for the exact value.

**Takeaway:**UK CPI fell from 3.8% to a low of 2.6% in June 2026, then turned back up to 3.1% in August; with the next print due on 21 October, each 0.1-point surprise matters for GBP/USD and Bank Rate expectations.

*Source: Office for National Statistics, series D7G7 (CPI annual rate, all items) in dataset MM23, retrieved from the ONS time series endpoint in October 2026. Contains public sector information licensed under the Open Government Licence v3.0.*

## API format and developer ergonomics

The ONS formats are reasonable, but they are UK-specific. Time series values arrive as strings, period labels such as`2026 AUG`or`2026 MAY-JUL`need parsing, and labour market series are labelled by three-month rolling windows. The beta API uses dataset, edition, and version identifiers plus dimension codes (for example`geography=K02000001`for the UK and an`aggregate`code for the CPIH component), which you discover through the dimensions and code-list services. Finding the right four-character series ID for each indicator is a research task of its own.

FXMacroData uses one flat JSON shape for every currency and indicator. UK CPI,[UK GDP](/api-data-docs/gbp/gdp) , the[UK unemployment rate](/api-data-docs/gbp/unemployment) , US[CPI](/usd/inflation#api-docs) , and the[ECB policy rate](/eurozone/policy-rate#api-docs) all come back as rows with the same fields, documented in OpenAPI at[/documentation/reference](/documentation/reference) . Authentication is a single header.

```
curl -H "X-API-Key: YOUR_API_KEY" "https://api.fxmacrodata.com/v1/announcements/gbp/inflation"
```

**Example response (abridged, illustrative)**

```
{
  "currency": "GBP",
  "indicator": "inflation",
  "data": [
    {
      "date": "2026-08-01",
      "val": 3.1,
      "previous_value": 2.9,
      "announcement_datetime": 1789538400
    }
  ]
}
```

**`date`**is the reference period (August 2026).

**`announcement_datetime`**1789538400 is 2026-09-16 06:00:00 UTC, the 07:00 BST release.

**`val`**is a number, not a string, and`previous_value`sits on the row, so the surprise needs no second query.

**Takeaway:**the same row shape works for every currency, so one parser covers GBP, USD, EUR, and JPY releases.

## Rate limits and history

The ONS publishes its limits on the Developer Hub's rate limiting and bot guide: 120 requests per 10 seconds and 200 requests per minute across all site and API assets, and 15 requests per 10 seconds for high-demand site assets. Exceeding them returns HTTP 429 with a`Retry-After`header; clients that ignore it can be blocked for up to an hour, and the ONS reserves the right to change the limits without notice. It also asks bots to send a descriptive`User-Agent`with contact details. For a handful of headline series refreshed once a day, those limits are generous. For a poller watching many series at 07:00, they are the binding constraint.

On history, the ONS is hard to beat. The`D7G7`monthly series starts in 1989, quarterly GDP growth runs back decades, and the bulletins explain revisions in detail. FXMacroData's paid plans allow 1,000,000 requests/month with bursts of 300/minute, 5,000/hour, and 20 concurrent requests, and history is organised as release rows with announcement times and priors, which is the shape a no-lookahead backtest needs.

## Licence for programmatic and commercial use

The ONS footer states that all content is available under the Open Government Licence v3.0, except where otherwise stated. The OGL allows copying, publishing, adapting, and commercial exploitation, provided you attribute the source. For UK headline statistics, it is one of the most permissive licences in official data.

FXMacroData licences are plan-based: Individual covers one person's research, dashboards, and scripts; Business covers company use for up to 10 people; and the Commercial Redistribution add-on lets you show data to your own users for $10/month per block, without a quote process.

## Where the ONS is genuinely stronger

**ONS strengths**

- Publisher of record for UK statistics.

- Free, with no API key.

- CPI/CPIH component, regional, and labour market depth no FX vendor replicates.

- Long history and detailed revision notes.

- Open Government Licence reuse.

**ONS tradeoffs**

- Date-level release stamps, no publication time.

- Beta API with possible breaking changes and retiring routes.

- Some beta datasets lag the website.

- Shared rate limits that tighten around releases.

- UK only; no USD, EUR, or JPY side of the pair.

**FXMacroData strengths**

- Second-level`announcement_datetime`per release.

- One schema for 22 currencies, 700+ series.

- Calendar, FX rates, COT, yields, press releases.

- SSE streaming, OpenAPI, SDKs, and MCP.

**FXMacroData tradeoffs**

- Not the original publisher.

- Headline FX-relevant series, not every ONS breakdown.

- GBP data requires a paid plan.

**Takeaway:**the ONS's advantages are depth, authority, and cost; FXMacroData's are timing and cross-currency packaging.

If your work involves CPI by COICOP division, CPIH owner-occupier housing costs, regional GDP, labour market flows, or official citations for a research note, use the ONS. FXMacroData reads the same official UK releases and focuses on the headline series that move sterling, such as CPI, core CPI, GDP, unemployment,[wage growth](/api-data-docs/gbp/wages) ,[retail sales](/indicators/retail-sales) , and the Bank of England rate. It does not try to mirror the ONS catalogue.

## Where FXMacroData is stronger

FXMacroData's advantage shows up once the UK number has to sit next to everything else on the trade. A GBP/USD model needs the US side as well:[non-farm payrolls](/usd/labor/non-farm-payrolls#api-docs) , the[Fed policy rate](/united-states/policy-rate#api-docs) , and US CPI, plus FX spot, CFTC positioning on the[COT dashboard](/dashboard/cot) , and the gilt-Treasury spread from[bond yields](/dashboard/bond-yields) . The ONS covers none of the non-UK side, and the Bank Rate itself comes from the Bank of England rather than the ONS, so you would otherwise stitch together the ONS, the Bank of England, BLS, BEA, the Fed, and a price feed, each with its own format and timing.

**GBP/USD on UK CPI day**

**Before 07:00**

The[release calendar](/dashboard/release-calendar) shows UK CPI and any US data due later that day.

**At release**

An SSE event delivers the row; the bot compares`val`with`previous_value`and, optionally, a forecast.

**After**

`/v1/forex/GBP/USD`and gilt yields put the surprise in price context on the pair dashboard.

**In an agent**

An MCP-connected assistant summarises the print, the Bank Rate path, and the US calendar ahead.

**Takeaway:**the release-day workflow uses UK and US data in one schema, with timestamps a backtest can trust.

For AI workflows, FXMacroData's official MCP server lets Claude, ChatGPT, Cursor, and other clients query release rows, calendars, and FX rates directly, without writing an ONS adapter. Trading-platform guides cover MetaTrader, TradingView, and NinjaTrader.

## Decision matrix

Your situation Better fit Why Academic or policy research on UK inflation ONS Official source, full component depth, citable series IDs. Building an internal UK statistics warehouse ONS Datasets, filters, census, and free OGL reuse. Event study of GBP/USD around UK releases FXMacroData Per-release`announcement_datetime`instead of a date-level release stamp. Automated GBP trading bot FXMacroData SSE release events, calendar, FX spot, and measured release speed, without polling against shared rate limits. Cross-currency macro model (GBP, USD, EUR, JPY) FXMacroData One schema for 22 currencies; the ONS covers only the UK side. Occasional headline check at zero cost ONS Free, no key, and the numbers are the official ones. Audit trail for a published number Both Cite the ONS as the source; use FXMacroData rows for when the market knew it.

## Recommendation

If you need the deepest official view of UK statistics and can live with date-level release stamps, a beta API, and some parsing work, use the ONS: it is free, authoritative, and openly licensed. For headline series, the time series JSON (`D7G7`,`IHYQ`,`MGSX`) is the most reliable route; check the latest version of any beta API dataset before depending on it.

If you trade sterling crosses or build models that react to the 07:00 releases, FXMacroData is the better fit. You get second-level release timestamps, a measured speed record at[/release-speed](/release-speed) , GBP alongside 21 other currencies, and FX, COT, and yield data in the same API. Compare plans at[/pricing](/pricing) , read the endpoint reference at[/documentation/reference](/documentation/reference) , or start the 14-day Individual trial from the[subscribe page](/subscribe) .

**Bottom line**

The ONS is the free, official source for UK statistics, and it is the right choice for depth and citation. FXMacroData turns those releases into timestamped, cross-currency rows built for GBP/USD trading, backtests, and AI agents. Use the ONS to know what the number is; use FXMacroData to act on when it landed.

**Sources checked (October 2026)**

- ONS Developer Hub introduction (beta status, no API keys, base URL):[developer.ons.gov.uk](https://developer.ons.gov.uk/)

- ONS guide to rate limiting and bot development:[developer.ons.gov.uk/bots](https://developer.ons.gov.uk/bots/)

- ONS guide to retirement of API endpoints:[developer.ons.gov.uk/retirement](https://developer.ons.gov.uk/retirement/)

- ONS beta API dataset list and`cpih01`versions:[api.beta.ons.gov.uk/v1/datasets](https://api.beta.ons.gov.uk/v1/datasets)

- ONS time series D7G7 (CPI annual rate), JSON:[ons.gov.uk timeseries d7g7/mm23](https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/d7g7/mm23/data)

- ONS bulletin, Consumer price inflation, UK: August 2026:[ons.gov.uk consumer price inflation bulletin](https://www.ons.gov.uk/economy/inflationandpriceindices/bulletins/consumerpriceinflation/latest)

- ONS release calendar entries (CPI September 2026, GDP monthly estimate August 2026):[ons.gov.uk release calendar](https://www.ons.gov.uk/releasecalendar)

- Open Government Licence v3.0:[nationalarchives.gov.uk OGL v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)

- FXMacroData:[pricing](/pricing) ,[API reference](/documentation/reference) ,[release speed record](/release-speed) , and[MCP server](/mcp) .

## Related reading

- [FXMacroData vs Eurostat API](/articles/fxmacrodata-vs-eurostat-api)

- [FXMacroData vs ECB Data Portal API](/articles/fxmacrodata-vs-ecb-data-portal-api)

- [FXMacroData vs Trading Economics](/articles/fxmacrodata-vs-trading-economics)

- [Best macroeconomic data APIs in 2026](/articles/best-macroeconomic-data-apis-2026)

Source: FXMacroData
