API Access
Access dataset files directly from scripts, code, or AI agents.
Browse dataset files
API Access
Access dataset files directly from scripts, code, or AI agents.
Each file has a stable URL (r-link) that you can use directly in scripts, apps, or AI agents. These URLs are permanent and safe to hardcode.
Start with these files — they give you everything you need to understand and access the dataset.
- 1. Fetch datapackage.json to inspect schema and resources
- 2. Download data resources listed in datapackage.json
- 3. Read README.md for full context
Data Views
UK Consumer Price Index (Monthly)
UK Consumer Price Index (Annual)
UK Inflation (Annual)
Data Files
Explore with AIcpi-uk-annual
| Field | Type |
|---|---|
| Year | year |
| Price Index | number |
Download
Download CSVAbout
- Last updated
- 8 April 2026
- Total rows
- ...
- Format
- CSV
- File size
- 2.5 kB
cpi-uk-monthly
| Field | Type | Format |
|---|---|---|
| Date | date | any |
| Price Index | number |
Download
Download CSVAbout
- Last updated
- 1 May 2026
- Total rows
- ...
- Format
- CSV
- File size
- 16.9 kB
Annual percentage change of long term indicator of prices of consumer g&s
| Field | Type |
|---|---|
| Year | year |
| Inflation | number |
Download
Download CSVAbout
- Last updated
- 8 April 2026
- Total rows
- ...
- Format
- CSV
- File size
- 2.38 kB
About this dataset
Consumer Price Index (and hence inflation) for the UK from 1850 to the present (monthly since June 1947).
Data
Key source files are:
We take these and just to a split out of annual from monthly and some tidying of the date format (see scripts/process.js).
Processing
First do:
curl "http://www.ons.gov.uk/ons/datasets-and-tables/downloads/csv.csv?dataset=mm23&cdid=CDKO" > cache/cpi-uk.csv
Then run the processing script to split out monthly and annual (they put them in the same file …):
node scripts/process.js
Rant
Why is it always so complicated to get data. A quick search on the interwebs yields: http://www.ons.gov.uk/ons/rel/cpi/consumer-price-indices/october-2012/cpi-time-series-data.html
But this turns out to be so big that it does not open in a spreadsheet programme (if you take CSV). In addition all the series descriptions are mixed in at the bottom of the file so this is not machine processable!
Let's try instead to go for the series selector to try and break it down: http://www.ons.gov.uk/ons/datasets-and-tables/data-selector.html?dataset=mm23
But this is about 20 different series - which one do you want? Make an educated guess and repeat each time you're wrong!