API AccessAccess dataset files directly from scripts, code, or AI agents.
Browse dataset files
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
Data Previews
cpi-uk-annual
Schema
| name | type |
|---|---|
| Year | year |
| Price Index | number |
cpi-uk-monthly
Schema
| name | type | format |
|---|---|---|
| Date | date | any |
| Price Index | number |
Annual percentage change of long term indicator of prices of consumer g&s
Schema
| name | type |
|---|---|
| Year | year |
| Inflation | number |
Data Files
| File | Description | Size | Last modified | Download |
|---|---|---|---|---|
cpi-uk-annual | 2.5 kB | about 2 months ago | cpi-uk-annual | |
cpi-uk-monthly | 16.9 kB | 2 days ago | cpi-uk-monthly | |
inflation-uk | 2.38 kB | about 2 months ago | inflation-uk |
| Files | Size | Format | Created | Updated | License | Source |
|---|---|---|---|---|---|---|
| 3 | 21.7 kB | csv | 2 days ago | Open Data Commons Public Domain Dedication and License v1.0 | Office of National Statistics |
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!