Updated

UK Consumer Price Index

Consumer Price Index (and hence inflation) for the UK from 1850 to the present (monthly since June 1947). Key source files are: Price Index 1800 to Present Inflation 1800 to Present We take the...

API Access

Access dataset files directly from scripts, code, or AI agents.

Browse dataset files
Dataset Files

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.

/core/cpi-gb/
https://datahub.io/core/cpi-gb/_r/-/README.md
https://datahub.io/core/cpi-gb/_r/-/cache/cpi-uk.csv
https://datahub.io/core/cpi-gb/_r/-/cache/inflation-uk.csv
https://datahub.io/core/cpi-gb/_r/-/data/cpi-uk-annual.csv
https://datahub.io/core/cpi-gb/_r/-/data/cpi-uk-monthly.csv
https://datahub.io/core/cpi-gb/_r/-/data/inflation-uk.csv
https://datahub.io/core/cpi-gb/_r/-/datapackage.json
Key Files

Start with these files — they give you everything you need to understand and access the dataset.

datapackage.jsonmetadata & schema
https://datahub.io/core/cpi-gb/_r/-/datapackage.json
README.mddocumentation
https://datahub.io/core/cpi-gb/_r/-/README.md
Typical Usage
  1. 1. Fetch datapackage.json to inspect schema and resources
  2. 2. Download data resources listed in datapackage.json
  3. 3. Read README.md for full context

Data Views

Data Previews

cpi-uk-annual

Loading data...

Schema

nametype
Yearyear
Price Indexnumber

cpi-uk-monthly

Loading data...

Schema

nametypeformat
Datedateany
Price Indexnumber

Annual percentage change of long term indicator of prices of consumer g&s

Loading data...

Schema

nametype
Yearyear
Inflationnumber

Data Files

FileDescriptionSizeLast modifiedDownload
cpi-uk-annual
2.5 kBabout 2 months ago
cpi-uk-annual
cpi-uk-monthly
16.9 kB2 days ago
cpi-uk-monthly
inflation-uk
2.38 kBabout 2 months ago
inflation-uk
FilesSizeFormatCreatedUpdatedLicenseSource
321.7 kBcsv2 days agoOpen Data Commons Public Domain Dedication and License v1.0Office of National Statistics

badge

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!