Office for National Statistics
App · 15 actions
Read the UK's official statistics from the Office for National Statistics: inflation, employment, GDP, trade, population, deaths and the Census 2021. Get any time series by its ID, query datasets and Census tables, search the website, check the release calendar, and start workflows when new figures are published. No account or API key required.
Actions
| Action | What it does |
|---|---|
| Find Census 2021 areas | Find Census 2021 areas of one type (countries, regions, local authorities, wards, neighbourhoods...) by name, for the codes Get Census 2021 data takes. |
| Find datasets using a code | Find the datasets that have data for a code, such as every dataset with figures for Wales or for one industry, with their latest versions. |
| Get Census 2021 data | Get the counts in a Census 2021 table (such as people by sex, or households by size) for every area of a type, such as each region or local authority, or only the areas you choose. |
| Get dataset | Get one dataset's details: what it holds, how often it is released and when next, its latest edition and version, who to contact and how it is made. |
| Get observations | Get values from a filterable dataset: choose one option of each dimension (a month, a place, a measure...) for one value, or * for one dimension to get all of its values at once, such as a monthly series. |
| Get time series | Get one of the ONS's time series by its CDID, such as D7G7 for CPI inflation or MGSX for the unemployment rate: its latest value, the one before and the change, when the next release is due, and its recent monthly, quarterly or yearly values. |
| Get version | Get one version of a dataset, the latest by default: its release date, its dimensions (what its values vary by, such as time and geography), its CSV and Excel downloads, alerts, usage notes and what changed. |
| List codes | List the codes of a code list (geographies, industries, products, time periods...) with what each stands for, optionally only those matching some words, such as a place name. |
| List datasets | List the ONS's datasets, A to Z by title: filterable datasets (inflation, GDP, deaths, earnings...), Census 2021 tables and static files. |
| List dimension options | List the options of one dimension of a dataset, such as every month, place or measure it has, with their ids: the values Get observations takes. |
| List editions | List a dataset's editions (such as time-series, or one per year) with each one's latest version. |
| List releases | List the ONS release calendar: the statistics it will publish and when (confirmed or provisional), what it has published, or what it cancelled, with any change of date and why. |
| List topics | List the topics the ONS files its statistics under (Economy, Employment and labour market...), or the subtopics of one, with the ids Search filters by. |
| List versions | List the versions of a dataset's edition, newest first: each release or correction, with its release date, its downloads and any alerts. |
| Search | Search the ONS website: statistical bulletins, articles, time series, datasets, methodologies and more, narrowed by kind, topic and release date. |
Find Census 2021 areas
Find Census 2021 areas of one type (countries, regions, local authorities, wards, neighbourhoods...) by name, for the codes Get Census 2021 data takes.
Inputs
- Area type
area_typetextRequired - The kind of area, such as ltla (local authorities) or msoa.
- Name
searchtext - Only areas whose name contains this, such as Cardiff.
- Number of areas
limitnumber - How many areas to return, 1 to 1,000. Defaults to 100.From 1 to 1000.
Outputs
area_typetext- The area type searched.
area_type_labeltext- What the area type is called.
areaslist- The areas found.
countnumber- How many areas are listed.
total_countnumber- How many areas match.
Example output
{
"area_type": "ctry",
"area_type_label": "Countries",
"areas": [
{
"area_type": "ctry",
"code": "W92000004",
"name": "Wales"
}
],
"count": 1,
"total_count": 1
}Find datasets using a code
Find the datasets that have data for a code, such as every dataset with figures for Wales or for one industry, with their latest versions.
Inputs
- Code list
code_listtextRequired - The code list, such as administrative-geography. Get version names the code list of each dimension.
- Code
codetextRequired - The code, such as W92000004 for Wales. List codes finds it.
- Edition
editiontext - The code list's edition. Leave empty for its first one.
Outputs
codetext- The code looked up.
code_listtext- The code list the code is in.
countnumber- How many dataset editions use it.
datasetslist- The dataset editions using it.
editiontext- The code list's edition.
Example output
{
"code": "K02000001",
"code_list": "uk-only",
"count": 2,
"datasets": [
{
"dataset_id": "ashe-table-5",
"dimension_label": "United Kingdom",
"edition": "time-series",
"latest_version": 7,
"url": "https://www.ons.gov.uk/datasets/ashe-table-5/editions/time-series/versions/7"
},
{
"dataset_id": "ashe-tables-25",
"dimension_label": "United Kingdom",
"edition": "time-series",
"latest_version": 7,
"url": "https://www.ons.gov.uk/datasets/ashe-tables-25/editions/time-series/versions/7"
}
],
"edition": "one-off"
}Get Census 2021 data
Get the counts in a Census 2021 table (such as people by sex, or households by size) for every area of a type, such as each region or local authority, or only the areas you choose.
Inputs
- Census 2021 table
dataset_idtextRequired - The Census 2021 table, such as TS008 (Sex) or TS021 (Ethnic group).
- Area type
area_typetext - The kind of area to count by, such as ctry (countries), rgn (regions) or ltla (local authorities). Leave empty for local authorities.
- Areas
areastext - Only these areas of the area type: pick one, or type several codes separated by commas, such as E92000001,W92000004. Leave empty for all of them. Find Census 2021 areas looks codes up by name.
- Edition
editiontext - The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version
versiontext - The version number. Leave empty for the edition's latest, so the step follows each new release. Pick an edition first to choose one.
- Number of rows
limitnumber - The most rows to return, 1 to 20,000. Defaults to 1,000.From 1 to 20000.
Outputs
area_typetext- The area type counted by.
blocked_areasnumber- Areas the ONS withheld to protect privacy.
countnumber- How many rows are listed.
dataset_idtext- The dataset's id.
dimensionslist- The table's dimensions: the areas first, then its categories.
editiontext- The edition read.
rowslist- One count per area and category.
rows_left_outnumber- Counts left out past Number of rows.
total_areasnumber- How many areas the table has of this type.
total_observationsnumber- How many counts the ONS returned.
versionnumber- The version read.
Example output
{
"area_type": "ctry",
"blocked_areas": 0,
"count": 2,
"dataset_id": "TS008",
"dimensions": [
{
"label": null,
"name": "ctry",
"option_count": 1
},
{
"label": "Sex (2 categories)",
"name": "sex",
"option_count": 2
}
],
"edition": "2021",
"rows": [
{
"area_code": "W92000004",
"area_name": "Wales",
"categories": [
{
"code": "1",
"dimension": "sex",
"label": "Female"
}
],
"category": "Female",
"value": 1586490
},
{
"area_code": "W92000004",
"area_name": "Wales",
"categories": [
{
"code": "2",
"dimension": "sex",
"label": "Male"
}
],
"category": "Male",
"value": 1521004
}
],
"rows_left_out": 0,
"total_areas": 1,
"total_observations": 2,
"version": 4
}Get dataset
Get one dataset's details: what it holds, how often it is released and when next, its latest edition and version, who to contact and how it is made.
Inputs
- Dataset
dataset_idtextRequired - The dataset. Pick it, or give its id from an earlier step, such as cpih01.
Outputs
contactslist- Who to contact about it.
dataset_kindtext- filterable (Get observations reads it), census (a Census 2021 table, read with Get Census 2021 data) or static (a file to download).
descriptiontext- What the dataset holds.
idtext- The dataset's id, such as cpih01 or TS008: what the other steps take.
keywordslist- Keywords the ONS tags the dataset with.
last_updatedtext- When the dataset last changed, ISO 8601 UTC.
latest_editiontext- The edition its latest version belongs to, such as time-series.
latest_versionnumber- The number of its latest version.
licensetext- The licence it is published under.
methodologieslist- Pages explaining how it is made.
national_statistictrue/false- Whether it is an accredited official statistic.
next_releasetext- When the next release is due, as the ONS writes it.
population_typetext- For a Census 2021 table, the population it counts, such as UR.
qmi_urltext- Its quality and methodology information page.
related_datasetslist- Related datasets on the ONS website.
release_frequencytext- How often it is updated, such as Monthly.
titletext- The dataset's name.
typetext- The ONS's own type, such as cantabular_flexible_table, filterable or static.
unit_of_measuretext- What its values measure, such as Index: 2015=100.
urltext- The dataset's page on the ONS website.
Example output
{
"contacts": [
{
"email": "gdp@ons.gov.uk",
"name": "Gross Domestic Product team",
"telephone": "+44 (0)1633 455284"
}
],
"dataset_kind": "filterable",
"description": "Gross domestic product (GDP) measures the value of goods and services produced in the UK. It estimates the size of and growth in the economy.",
"id": "gdp-to-four-decimal-places",
"keywords": [
"GDP",
"economy"
],
"last_updated": "2026-08-24T10:33:16.983Z",
"latest_edition": "time-series",
"latest_version": 69,
"license": null,
"methodologies": [],
"national_statistic": false,
"next_release": "16 April 2026",
"population_type": null,
"qmi_url": "https://www.ons.gov.uk/economy/grossdomesticproductgdp/methodologies/grossdomesticproductgdpqmi",
"related_datasets": [],
"release_frequency": "Monthly",
"title": "GDP monthly estimate (incorporating the Index of Services and Index of Production)",
"type": null,
"unit_of_measure": "Index. Seasonally adjusted 2016=100",
"url": "https://www.ons.gov.uk/datasets/gdp-to-four-decimal-places"
}Get observations
Get values from a filterable dataset: choose one option of each dimension (a month, a place, a measure...) for one value, or * for one dimension to get all of its values at once, such as a monthly series. Reads the latest version unless you choose one.
Inputs
- Dataset
dataset_idtextRequired - The dataset to read, one of the filterable ones. Census 2021 tables are read with Get Census 2021 data.
- Dimensions
dimensionsobjectRequired - Pick one option for every dimension, such as a month, a place and a measure. Pick * (every option) for at most one of them to get a series, such as every month. The choices come from the latest version.
- Edition
editiontext - The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version
versiontext - The version number. Leave empty for the edition's latest, so the step follows each new release. Pick an edition first to choose one.
Outputs
countnumber- How many values came back.
dataset_idtext- The dataset's id.
editiontext- The edition read.
observationslist- The values, in time order when the * dimension is time.
selectionsobject- The option asked for in each dimension, keyed by dimension.
total_observationsnumber- How many values the ONS found.
unit_of_measuretext- What the values measure, such as Index: 2015=100.
versionnumber- The version read.
wildcard_dimensiontext- The dimension given as *, if any.
Example output
{
"count": 2,
"dataset_id": "gdp-to-four-decimal-places",
"edition": "time-series",
"observations": [
{
"label": "Jan-97",
"metadata": {},
"option": "Jan-97",
"raw_value": "61.6483",
"value": 61.6483
},
{
"label": "Feb-97",
"metadata": {},
"option": "Feb-97",
"raw_value": "61.9102",
"value": 61.9102
}
],
"selections": {
"geography": "K02000001",
"time": "*",
"unofficialstandardindustrialclassification": "A--T"
},
"total_observations": 354,
"unit_of_measure": "Index. Seasonally adjusted 2016=100",
"version": 69,
"wildcard_dimension": "time"
}Get time series
Get one of the ONS's time series by its CDID, such as D7G7 for CPI inflation or MGSX for the unemployment rate: its latest value, the one before and the change, when the next release is due, and its recent monthly, quarterly or yearly values.
Inputs
- Series ID (CDID)
cdidtextRequired - The four-character code the ONS gives the series, shown on its page and in Search results.
- Dataset code
dataset_codetext - Only when the series is published in several datasets: the one to read, such as QNA for ABMI. Leave empty for the one updated most recently.
- Frequency
frequencytext - Which values to list. Defaults to the most frequent the series has.One of:
months(Monthly),quarters(Quarterly),years(Yearly). - From
from_datedate - Only periods starting on or after this date.
- Until
to_datedate - Only periods starting on or before this date.
- Number of values
limitnumber - How many of the most recent values to list, 1 to 5,000. Defaults to 24.From 1 to 5000.
Outputs
cdidtext- The series' CDID, such as D7G7.
changenumber- The latest value minus the one before it.
contact_emailtext- Who to email about the series.
countnumber- How many values are listed.
dataset_idtext- The dataset it is read from, such as MM23.
frequencieslist- The frequencies the series has.
frequencytext- Which values are listed: months, quarters or years.
latest_periodtext- The latest period with a value.
latest_valuenumber- The latest value.
next_releasetext- When the next release is due, as the ONS writes it.
notetext- The ONS's note on what the value means, such as Change over 12 months.
observationslist- The values asked for, oldest first.
pre_unittext- The unit before a value, such as £.
previous_periodtext- The period before it.
previous_valuenumber- The value before it.
release_datetext- When the series was last published, ISO 8601 UTC.
titletext- The series' name.
total_countnumber- How many values fall in the dates asked for.
unittext- The unit after a value, such as %.
urltext- The series' page on the ONS website.
Example output
{
"cdid": "D7G7",
"change": 0.4,
"contact_email": "cpi@ons.gov.uk",
"count": 2,
"dataset_id": "MM23",
"frequencies": [
"months",
"quarters"
],
"frequency": "months",
"latest_period": "2026 SEP",
"latest_value": 3.5,
"next_release": "18 November 2026",
"note": "Change over 12 months",
"observations": [
{
"period": "2026 AUG",
"start_date": "2026-08-01",
"updated_at": "2026-09-15T23:00:00.000Z",
"value": 3.1
},
{
"period": "2026 SEP",
"start_date": "2026-09-01",
"updated_at": "2026-10-20T23:00:00.000Z",
"value": 3.5
}
],
"pre_unit": null,
"previous_period": "2026 AUG",
"previous_value": 3.1,
"release_date": "2026-10-20T23:00:00.000Z",
"title": "CPI ANNUAL RATE 00: ALL ITEMS 2015=100",
"total_count": 453,
"unit": "%",
"url": "https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/d7g7/mm23"
}Get version
Get one version of a dataset, the latest by default: its release date, its dimensions (what its values vary by, such as time and geography), its CSV and Excel downloads, alerts, usage notes and what changed.
Inputs
- Dataset
dataset_idtextRequired - The dataset. Pick it, or give its id from an earlier step, such as cpih01.
- Edition
editiontext - The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version
versiontext - The version number. Leave empty for the edition's latest, so the step follows each new release. Pick an edition first to choose one.
Outputs
alertslist- Notices about this version, such as corrections.
dataset_idtext- The dataset's id.
dataset_kindtext- filterable, census or static: which step reads its values.
dimensionslist- What its values vary by.
downloadslist- The whole version as files to download.
editiontext- The edition it belongs to.
last_updatedtext- When it last changed, ISO 8601 UTC.
latest_changeslist- What changed in this version.
lowest_geographytext- For a Census 2021 table, the smallest areas it covers.
release_datetext- When it was released, ISO 8601 UTC.
statetext- Its publishing state, such as published.
typetext- The ONS's own type, such as v4 or cantabular_flexible_table.
urltext- The version's page on the ONS website.
usage_noteslist- Notes on using the data.
versionnumber- The version number.
Example output
{
"alerts": [
{
"date": "2026-07-07T12:00:00.000Z",
"description": "This page is no longer being updated. Data are available up to January 2026 on this page. For more recent Consumer Price Index (CPI) data, please use our published tables and time series datasets on the ONS website.",
"type": "alert"
}
],
"dataset_id": "cpih01",
"dataset_kind": "filterable",
"dimensions": [
{
"code_list": "mmm-yy",
"description": null,
"is_area_type": null,
"label": "Time",
"name": "time",
"option_count": null
},
{
"code_list": "uk-only",
"description": null,
"is_area_type": null,
"label": "Geography",
"name": "geography",
"option_count": null
}
],
"downloads": [
{
"format": "xlsx",
"size_bytes": 285345,
"url": "https://download.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/67.xlsx"
},
{
"format": "csv",
"size_bytes": 4702653,
"url": "https://download.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/67.csv"
}
],
"edition": "time-series",
"last_updated": "2026-02-18T10:25:16.839Z",
"latest_changes": [],
"lowest_geography": null,
"release_date": "2026-02-18T00:00:00.000Z",
"state": "published",
"type": "v4",
"url": "https://www.ons.gov.uk/datasets/cpih01/editions/time-series/versions/67",
"usage_notes": [],
"version": 67
}List codes
List the codes of a code list (geographies, industries, products, time periods...) with what each stands for, optionally only those matching some words, such as a place name.
Inputs
- Code list
code_listtextRequired - The code list, such as administrative-geography. Get version names the code list of each dimension.
- Edition
editiontext - The code list's edition. Leave empty for its first one.
- Search
searchtext - Only codes whose code or label contains all these words, such as cardiff.
- Number of codes
limitnumber - How many codes to return, 1 to 1,000. Defaults to 100.From 1 to 1000.
Outputs
code_listtext- The code list read.
codeslist- The codes.
countnumber- How many codes are listed.
editiontext- Its edition read.
total_countnumber- How many codes match.
Example output
{
"code_list": "administrative-geography",
"codes": [
{
"code": "E05004408",
"label": "Ashchurch with Walton Cardiff"
},
{
"code": "W06000015",
"label": "Cardiff"
}
],
"count": 2,
"edition": "one-off",
"total_count": 2
}List datasets
List the ONS's datasets, A to Z by title: filterable datasets (inflation, GDP, deaths, earnings...), Census 2021 tables and static files. Narrow them by kind or by words, and see each one's latest edition and version.
Inputs
- Kind
dataset_kindtext - Only datasets of this kind. Leave empty for all of them.One of:
filterable(Filterable datasets (read with Get observations)),census(Census 2021 tables (read with Get Census 2021 data)),static(Static datasets (files to download)). - Search
searchtext - Only datasets whose id, title, description or keywords contain all these words, such as house prices.
- Number of results
limitnumber - How many datasets to return, 1 to 1,000. Defaults to 50.From 1 to 1000.
- Skip
offsetnumber - How many results to skip, for the next page. Defaults to 0.From 0 to 10000.
Outputs
countnumber- How many datasets are listed.
datasetslist- The datasets, A to Z by title.
total_countnumber- How many datasets match, across every page.
Example output
{
"count": 2,
"datasets": [
{
"contacts": [
{
"email": "regionalgdp@ons.gov.uk",
"name": "Keith Barnes",
"telephone": "+441633 456630"
}
],
"dataset_kind": "filterable",
"description": "Annual economic activity within England, Wales and the nine English regions (North East, North West, Yorkshire and the Humber, East Midlands, West Midlands, East of England, Greater London, South East, South West).",
"id": "regional-gdp-by-year",
"keywords": [
"regional GDP"
],
"last_updated": "2023-05-24T08:36:20.126Z",
"latest_edition": "time-series",
"latest_version": 6,
"license": null,
"methodologies": [],
"national_statistic": false,
"next_release": "TBA",
"population_type": null,
"qmi_url": "https://www.ons.gov.uk/economy/grossdomesticproductgdp/methodologies/grossdomesticproductgdpukregionsandcountriesqmi",
"related_datasets": [],
"release_frequency": "Annual",
"title": "Annual GDP for England, Wales and the English regions",
"type": null,
"unit_of_measure": null,
"url": "https://www.ons.gov.uk/datasets/regional-gdp-by-year"
},
{
"contacts": [
{
"email": "regionalaccounts@ons.gov.uk",
"name": "Trevor Fenton",
"telephone": "+44 (0)1633 456083"
}
],
"dataset_kind": "filterable",
"description": "Gross domestic product (GDP) in current market prices and as chained volume measures, plus GDP per capita, for each local authority district, metropolitan district, London borough and Scottish Council area in the UK.",
"id": "gdp-by-local-authority",
"keywords": [],
"last_updated": "2021-06-25T05:49:50.245Z",
"latest_edition": "time-series",
"latest_version": 2,
"license": null,
"methodologies": [],
"national_statistic": null,
"next_release": "TBA",
"population_type": null,
"qmi_url": "https://www.ons.gov.uk/economy/regionalaccounts/grossdisposablehouseholdincome/methodologies/regionalaccounts",
"related_datasets": [],
"release_frequency": null,
"title": "GDP by local authority",
"type": "filterable",
"unit_of_measure": null,
"url": "https://www.ons.gov.uk/datasets/gdp-by-local-authority"
}
],
"total_count": 4
}List dimension options
List the options of one dimension of a dataset, such as every month, place or measure it has, with their ids: the values Get observations takes. Search them by name.
Inputs
- Dataset
dataset_idtextRequired - The dataset. Pick it, or give its id from an earlier step, such as cpih01.
- Dimension
dimensiontextRequired - The dimension whose options to list, such as geography or time.
- Edition
editiontext - The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version
versiontext - The version number. Leave empty for the edition's latest, so the step follows each new release. Pick an edition first to choose one.
- Search
searchtext - Only options whose id or name contains all these words, such as wales.
- Number of options
limitnumber - How many options to return, 1 to 1,000. Defaults to 200.From 1 to 1000.
Outputs
countnumber- How many options are listed.
dataset_idtext- The dataset's id.
dimensiontext- The dimension listed.
editiontext- The edition read.
optionslist- The dimension's options.
total_countnumber- How many options match.
versionnumber- The version read.
Example output
{
"count": 2,
"dataset_id": "gdp-to-four-decimal-places",
"dimension": "unofficialstandardindustrialclassification",
"edition": "time-series",
"options": [
{
"code_list": "sic-unofficial",
"label": "A-T : Monthly GDP",
"option": "A--T"
},
{
"code_list": "sic-unofficial",
"label": "A : Agriculture",
"option": "A"
}
],
"total_count": 27,
"version": 69
}List editions
List a dataset's editions (such as time-series, or one per year) with each one's latest version.
Inputs
- Dataset
dataset_idtextRequired - The dataset. Pick it, or give its id from an earlier step, such as cpih01.
Outputs
countnumber- How many editions it has.
dataset_idtext- The dataset's id.
editionslist- The dataset's editions.
Example output
{
"count": 2,
"dataset_id": "weekly-deaths-age-sex",
"editions": [
{
"edition": "covid-19",
"latest_version": 170,
"state": "published",
"url": "https://www.ons.gov.uk/datasets/weekly-deaths-age-sex/editions/covid-19"
},
{
"edition": "2010-19",
"latest_version": 2,
"state": "published",
"url": "https://www.ons.gov.uk/datasets/weekly-deaths-age-sex/editions/2010-19"
}
]
}List releases
List the ONS release calendar: the statistics it will publish and when (confirmed or provisional), what it has published, or what it cancelled, with any change of date and why.
Inputs
- Releases
statustext - Which releases to list. Defaults to upcoming ones.One of:
upcoming,published,cancelled. Default:upcoming. - Search for
querytext - Only releases matching these words, such as inflation.
- From
from_datedate - Only releases on or after this date.
- Until
to_datedate - Only releases on or before this date.
- Census releases only
census_onlytrue/false - Only Census releases.
- Order
sorttext - How to order them. Defaults to earliest first for upcoming releases and latest first for the others.One of:
release_date_asc(Earliest first),release_date_desc(Latest first),relevance(Most relevant first),title_asc(Title, A to Z). - Number of releases
limitnumber - How many releases to return, 1 to 1,000. Defaults to 20.From 1 to 1000.
- Skip
offsetnumber - How many results to skip, for the next page. Defaults to 0.From 0 to 10000.
Outputs
countnumber- How many releases are listed.
releaseslist- The releases.
statustext- Which releases were listed.
total_countnumber- How many releases match, across every page.
Example output
{
"count": 2,
"releases": [
{
"census": false,
"date_changes": [],
"postponed": false,
"provisional_date": null,
"release_date": "2026-11-18T07:00:00.000Z",
"status": "confirmed",
"summary": "The time series dataset connected to the Producer price inflation, UK: October 2026 bulletin.",
"title": "Producer price inflation, UK: October 2026 time series",
"uri": "/releases/producerpriceinflationukoctober2026timeseries",
"url": "https://www.ons.gov.uk/releases/producerpriceinflationukoctober2026timeseries"
},
{
"census": false,
"date_changes": [],
"postponed": false,
"provisional_date": null,
"release_date": "2026-11-18T07:00:00.000Z",
"status": "confirmed",
"summary": "Price indices percentage changes and weights for the different measures of consumer price inflation.",
"title": "Consumer price inflation, UK: October 2026",
"uri": "/releases/consumerpriceinflationukoctober2026",
"url": "https://www.ons.gov.uk/releases/consumerpriceinflationukoctober2026"
}
],
"status": "upcoming",
"total_count": 70
}List topics
List the topics the ONS files its statistics under (Economy, Employment and labour market...), or the subtopics of one, with the ids Search filters by.
Inputs
- Topic
parent_topictext - List this topic's subtopics. Leave empty for the top-level topics.
Outputs
countnumber- How many topics are listed.
parent_topictext- The topic whose subtopics were listed, if any.
topicslist- The topics.
Example output
{
"count": 2,
"parent_topic": "1245",
"topics": [
{
"description": "Manufacturing, production and services indices (measuring total economic output) and productivity (measuring efficiency, expressed as a ratio of output to input over a given period of time, for example output per person per hour).",
"id": "2621",
"keywords": [],
"parent_id": "1245",
"slug": "economicoutputandproductivity",
"subtopic_count": 3,
"title": "Economic output and productivity"
},
{
"description": "Environmental accounts show how the environment contributes to the economy (for example, through the extraction of raw materials), the impacts that the economy has on the environment (for example, energy consumption and air emissions), and how society responds to environmental issues (for example, through taxation and expenditure on environmental protection).",
"id": "3322",
"keywords": [],
"parent_id": "1245",
"slug": "environmentalaccounts",
"subtopic_count": 0,
"title": "Environmental accounts"
}
]
}List versions
List the versions of a dataset's edition, newest first: each release or correction, with its release date, its downloads and any alerts.
Inputs
- Dataset
dataset_idtextRequired - The dataset. Pick it, or give its id from an earlier step, such as cpih01.
- Edition
editiontext - The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Number of versions
limitnumber - How many versions to return, newest first, 1 to 1,000. Defaults to 20.From 1 to 1000.
Outputs
countnumber- How many versions are listed.
dataset_idtext- The dataset's id.
editiontext- The edition listed.
total_countnumber- How many versions the edition has.
versionslist- The versions, newest first.
Example output
{
"count": 2,
"dataset_id": "gdp-to-four-decimal-places",
"edition": "time-series",
"total_count": 69,
"versions": [
{
"alerts": [],
"downloads": [
{
"format": "xlsx",
"size_bytes": 77860,
"url": "https://download.ons.gov.uk/downloads/datasets/gdp-to-four-decimal-places/editions/time-series/versions/69.xlsx"
},
{
"format": "csv",
"size_bytes": 813664,
"url": "https://download.ons.gov.uk/downloads/datasets/gdp-to-four-decimal-places/editions/time-series/versions/69.csv"
}
],
"edition": "time-series",
"last_updated": "2026-08-24T10:33:21.517Z",
"release_date": "2026-08-24T00:00:00.000Z",
"state": "published",
"url": "https://www.ons.gov.uk/datasets/gdp-to-four-decimal-places/editions/time-series/versions/69",
"version": 69
},
{
"alerts": [
{
"date": "2026-05-28T11:00:00.000Z",
"description": "We have corrected an error in our Index of Production and industry sectors to four decimal places dataset. The previous version was incorrect for some data points in the top-level Index of Production 4dp index series. This happened because of a processing error. The effects of this change are minor, with differences seen to the fourth decimal place. We apologise for this error.",
"type": "correction"
}
],
"downloads": [
{
"format": "xlsx",
"size_bytes": 77248,
"url": "https://download.ons.gov.uk/downloads/datasets/gdp-to-four-decimal-places/editions/time-series/versions/68.xlsx"
},
{
"format": "csv",
"size_bytes": 806752,
"url": "https://download.ons.gov.uk/downloads/datasets/gdp-to-four-decimal-places/editions/time-series/versions/68.csv"
}
],
"edition": "time-series",
"last_updated": "2026-05-18T13:07:52.544Z",
"release_date": "2026-05-15T00:00:00.000Z",
"state": "published",
"url": "https://www.ons.gov.uk/datasets/gdp-to-four-decimal-places/editions/time-series/versions/68",
"version": 68
}
]
}Search
Search the ONS website: statistical bulletins, articles, time series, datasets, methodologies and more, narrowed by kind, topic and release date. Time series results carry the CDID Get time series takes.
Inputs
- Search for
querytext - Words to search for, such as consumer price inflation.
- Content types
content_typeslist - Only these kinds of page. Leave empty for every kind.One or more of:
bulletin(Statistical bulletins),article(Articles),timeseries(Time series),dataset_landing_page(Datasets),static_adhoc(User requested data),release(Release calendar entries),static_methodology(Methodologies),static_qmi(Quality and methodology information),static_foi(Freedom of Information responses),compendium_landing_page(Compendiums). - Topic
topictext - Only pages filed under this topic.
- Order
sorttext - How to order the results. Defaults to most relevant first.One of:
relevance(Most relevant first),release_date(Newest first),title(Title, A to Z). - Released from
from_datedate - Only pages released on or after this date.
- Released until
to_datedate - Only pages released on or before this date.
- Number of results
limitnumber - How many results to return, 1 to 1,000. Defaults to 10.From 1 to 1000.
- Skip
offsetnumber - How many results to skip, for the next page. Defaults to 0.From 0 to 10000.
Outputs
countnumber- How many results are listed.
resultslist- The pages found.
total_countnumber- How many results match, across every page.
Example output
{
"count": 2,
"results": [
{
"cdid": null,
"dataset_id": null,
"edition": "April 2026",
"keywords": [
"Economy",
"Retail"
],
"release_date": "2026-05-19T23:00:00.000Z",
"summary": "Price indices, percentage changes, and weights for the different measures of consumer price inflation.",
"title": "Consumer price inflation, UK",
"topics": [
"1245",
"4972"
],
"type": "bulletin",
"type_label": "Statistical bulletins",
"uri": "/economy/inflationandpriceindices/bulletins/consumerpriceinflation/april2026",
"url": "https://www.ons.gov.uk/economy/inflationandpriceindices/bulletins/consumerpriceinflation/april2026"
},
{
"cdid": null,
"dataset_id": null,
"edition": "August 2025",
"keywords": [
"Economy",
"Retail"
],
"release_date": "2025-09-16T23:00:00.000Z",
"summary": "Price indices, percentage changes, and weights for the different measures of consumer price inflation.",
"title": "Consumer price inflation, UK",
"topics": [
"1245",
"4972"
],
"type": "bulletin",
"type_label": "Statistical bulletins",
"uri": "/economy/inflationandpriceindices/bulletins/consumerpriceinflation/august2025",
"url": "https://www.ons.gov.uk/economy/inflationandpriceindices/bulletins/consumerpriceinflation/august2025"
}
],
"total_count": 632
}