# Office for National Statistics

> 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.

App · 15 actions. Web page: https://docs.lodol.com/docs/integrations/ons

## Actions

### 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_type`, text, required): The kind of area, such as ltla (local authorities) or msoa.
- Name (`search`, text): Only areas whose name contains this, such as Cardiff.
- Number of areas (`limit`, number): How many areas to return, 1 to 1,000. Defaults to 100. From 1 to 1000.

**Outputs**

- `area_type` (text): The area type searched.
- `area_type_label` (text): What the area type is called.
- `areas` (list): The areas found.
- `count` (number): How many areas are listed.
- `total_count` (number): How many areas match.

**Example output**

```json
{
  "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_list`, text, required): The code list, such as administrative-geography. Get version names the code list of each dimension.
- Code (`code`, text, required): The code, such as W92000004 for Wales. List codes finds it.
- Edition (`edition`, text): The code list's edition. Leave empty for its first one.

**Outputs**

- `code` (text): The code looked up.
- `code_list` (text): The code list the code is in.
- `count` (number): How many dataset editions use it.
- `datasets` (list): The dataset editions using it.
- `edition` (text): The code list's edition.

**Example output**

```json
{
  "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_id`, text, required): The Census 2021 table, such as TS008 (Sex) or TS021 (Ethnic group).
- Area type (`area_type`, text): The kind of area to count by, such as ctry (countries), rgn (regions) or ltla (local authorities). Leave empty for local authorities.
- Areas (`areas`, text): 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 (`edition`, text): The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version (`version`, text): 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 (`limit`, number): The most rows to return, 1 to 20,000. Defaults to 1,000. From 1 to 20000.

**Outputs**

- `area_type` (text): The area type counted by.
- `blocked_areas` (number): Areas the ONS withheld to protect privacy.
- `count` (number): How many rows are listed.
- `dataset_id` (text): The dataset's id.
- `dimensions` (list): The table's dimensions: the areas first, then its categories.
- `edition` (text): The edition read.
- `rows` (list): One count per area and category.
- `rows_left_out` (number): Counts left out past Number of rows.
- `total_areas` (number): How many areas the table has of this type.
- `total_observations` (number): How many counts the ONS returned.
- `version` (number): The version read.

**Example output**

```json
{
  "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_id`, text, required): The dataset. Pick it, or give its id from an earlier step, such as cpih01.

**Outputs**

- `contacts` (list): Who to contact about it.
- `dataset_kind` (text): filterable (Get observations reads it), census (a Census 2021 table, read with Get Census 2021 data) or static (a file to download).
- `description` (text): What the dataset holds.
- `id` (text): The dataset's id, such as cpih01 or TS008: what the other steps take.
- `keywords` (list): Keywords the ONS tags the dataset with.
- `last_updated` (text): When the dataset last changed, ISO 8601 UTC.
- `latest_edition` (text): The edition its latest version belongs to, such as time-series.
- `latest_version` (number): The number of its latest version.
- `license` (text): The licence it is published under.
- `methodologies` (list): Pages explaining how it is made.
- `national_statistic` (true/false): Whether it is an accredited official statistic.
- `next_release` (text): When the next release is due, as the ONS writes it.
- `population_type` (text): For a Census 2021 table, the population it counts, such as UR.
- `qmi_url` (text): Its quality and methodology information page.
- `related_datasets` (list): Related datasets on the ONS website.
- `release_frequency` (text): How often it is updated, such as Monthly.
- `title` (text): The dataset's name.
- `type` (text): The ONS's own type, such as cantabular_flexible_table, filterable or static.
- `unit_of_measure` (text): What its values measure, such as Index: 2015=100.
- `url` (text): The dataset's page on the ONS website.

**Example output**

```json
{
  "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_id`, text, required): The dataset to read, one of the filterable ones. Census 2021 tables are read with Get Census 2021 data.
- Dimensions (`dimensions`, object, required): 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 (`edition`, text): The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version (`version`, text): 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**

- `count` (number): How many values came back.
- `dataset_id` (text): The dataset's id.
- `edition` (text): The edition read.
- `observations` (list): The values, in time order when the * dimension is time.
- `selections` (object): The option asked for in each dimension, keyed by dimension.
- `total_observations` (number): How many values the ONS found.
- `unit_of_measure` (text): What the values measure, such as Index: 2015=100.
- `version` (number): The version read.
- `wildcard_dimension` (text): The dimension given as *, if any.

**Example output**

```json
{
  "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) (`cdid`, text, required): The four-character code the ONS gives the series, shown on its page and in Search results.
- Dataset code (`dataset_code`, text): 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 (`frequency`, text): Which values to list. Defaults to the most frequent the series has. One of: `months` (Monthly), `quarters` (Quarterly), `years` (Yearly).
- From (`from_date`, date): Only periods starting on or after this date.
- Until (`to_date`, date): Only periods starting on or before this date.
- Number of values (`limit`, number): How many of the most recent values to list, 1 to 5,000. Defaults to 24. From 1 to 5000.

**Outputs**

- `cdid` (text): The series' CDID, such as D7G7.
- `change` (number): The latest value minus the one before it.
- `contact_email` (text): Who to email about the series.
- `count` (number): How many values are listed.
- `dataset_id` (text): The dataset it is read from, such as MM23.
- `frequencies` (list): The frequencies the series has.
- `frequency` (text): Which values are listed: months, quarters or years.
- `latest_period` (text): The latest period with a value.
- `latest_value` (number): The latest value.
- `next_release` (text): When the next release is due, as the ONS writes it.
- `note` (text): The ONS's note on what the value means, such as Change over 12 months.
- `observations` (list): The values asked for, oldest first.
- `pre_unit` (text): The unit before a value, such as £.
- `previous_period` (text): The period before it.
- `previous_value` (number): The value before it.
- `release_date` (text): When the series was last published, ISO 8601 UTC.
- `title` (text): The series' name.
- `total_count` (number): How many values fall in the dates asked for.
- `unit` (text): The unit after a value, such as %.
- `url` (text): The series' page on the ONS website.

**Example output**

```json
{
  "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_id`, text, required): The dataset. Pick it, or give its id from an earlier step, such as cpih01.
- Edition (`edition`, text): The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version (`version`, text): 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**

- `alerts` (list): Notices about this version, such as corrections.
- `dataset_id` (text): The dataset's id.
- `dataset_kind` (text): filterable, census or static: which step reads its values.
- `dimensions` (list): What its values vary by.
- `downloads` (list): The whole version as files to download.
- `edition` (text): The edition it belongs to.
- `last_updated` (text): When it last changed, ISO 8601 UTC.
- `latest_changes` (list): What changed in this version.
- `lowest_geography` (text): For a Census 2021 table, the smallest areas it covers.
- `release_date` (text): When it was released, ISO 8601 UTC.
- `state` (text): Its publishing state, such as published.
- `type` (text): The ONS's own type, such as v4 or cantabular_flexible_table.
- `url` (text): The version's page on the ONS website.
- `usage_notes` (list): Notes on using the data.
- `version` (number): The version number.

**Example output**

```json
{
  "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_list`, text, required): The code list, such as administrative-geography. Get version names the code list of each dimension.
- Edition (`edition`, text): The code list's edition. Leave empty for its first one.
- Search (`search`, text): Only codes whose code or label contains all these words, such as cardiff.
- Number of codes (`limit`, number): How many codes to return, 1 to 1,000. Defaults to 100. From 1 to 1000.

**Outputs**

- `code_list` (text): The code list read.
- `codes` (list): The codes.
- `count` (number): How many codes are listed.
- `edition` (text): Its edition read.
- `total_count` (number): How many codes match.

**Example output**

```json
{
  "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_kind`, text): 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 (`search`, text): Only datasets whose id, title, description or keywords contain all these words, such as house prices.
- Number of results (`limit`, number): How many datasets to return, 1 to 1,000. Defaults to 50. From 1 to 1000.
- Skip (`offset`, number): How many results to skip, for the next page. Defaults to 0. From 0 to 10000.

**Outputs**

- `count` (number): How many datasets are listed.
- `datasets` (list): The datasets, A to Z by title.
- `total_count` (number): How many datasets match, across every page.

**Example output**

```json
{
  "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_id`, text, required): The dataset. Pick it, or give its id from an earlier step, such as cpih01.
- Dimension (`dimension`, text, required): The dimension whose options to list, such as geography or time.
- Edition (`edition`, text): The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Version (`version`, text): 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 (`search`, text): Only options whose id or name contains all these words, such as wales.
- Number of options (`limit`, number): How many options to return, 1 to 1,000. Defaults to 200. From 1 to 1000.

**Outputs**

- `count` (number): How many options are listed.
- `dataset_id` (text): The dataset's id.
- `dimension` (text): The dimension listed.
- `edition` (text): The edition read.
- `options` (list): The dimension's options.
- `total_count` (number): How many options match.
- `version` (number): The version read.

**Example output**

```json
{
  "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_id`, text, required): The dataset. Pick it, or give its id from an earlier step, such as cpih01.

**Outputs**

- `count` (number): How many editions it has.
- `dataset_id` (text): The dataset's id.
- `editions` (list): The dataset's editions.

**Example output**

```json
{
  "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 (`status`, text): Which releases to list. Defaults to upcoming ones. One of: `upcoming`, `published`, `cancelled`. Default: `upcoming`.
- Search for (`query`, text): Only releases matching these words, such as inflation.
- From (`from_date`, date): Only releases on or after this date.
- Until (`to_date`, date): Only releases on or before this date.
- Census releases only (`census_only`, true/false): Only Census releases.
- Order (`sort`, text): 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 (`limit`, number): How many releases to return, 1 to 1,000. Defaults to 20. From 1 to 1000.
- Skip (`offset`, number): How many results to skip, for the next page. Defaults to 0. From 0 to 10000.

**Outputs**

- `count` (number): How many releases are listed.
- `releases` (list): The releases.
- `status` (text): Which releases were listed.
- `total_count` (number): How many releases match, across every page.

**Example output**

```json
{
  "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_topic`, text): List this topic's subtopics. Leave empty for the top-level topics.

**Outputs**

- `count` (number): How many topics are listed.
- `parent_topic` (text): The topic whose subtopics were listed, if any.
- `topics` (list): The topics.

**Example output**

```json
{
  "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_id`, text, required): The dataset. Pick it, or give its id from an earlier step, such as cpih01.
- Edition (`edition`, text): The edition, such as time-series or 2021. Leave empty for the one the latest version belongs to.
- Number of versions (`limit`, number): How many versions to return, newest first, 1 to 1,000. Defaults to 20. From 1 to 1000.

**Outputs**

- `count` (number): How many versions are listed.
- `dataset_id` (text): The dataset's id.
- `edition` (text): The edition listed.
- `total_count` (number): How many versions the edition has.
- `versions` (list): The versions, newest first.

**Example output**

```json
{
  "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 (`query`, text): Words to search for, such as consumer price inflation.
- Content types (`content_types`, list): 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 (`topic`, text): Only pages filed under this topic.
- Order (`sort`, text): 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_date`, date): Only pages released on or after this date.
- Released until (`to_date`, date): Only pages released on or before this date.
- Number of results (`limit`, number): How many results to return, 1 to 1,000. Defaults to 10. From 1 to 1000.
- Skip (`offset`, number): How many results to skip, for the next page. Defaults to 0. From 0 to 10000.

**Outputs**

- `count` (number): How many results are listed.
- `results` (list): The pages found.
- `total_count` (number): How many results match, across every page.

**Example output**

```json
{
  "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
}
```
