ONS

Official statistics by area

Searches the datasets the Office for National Statistics publishes through its beta API, shows the latest release of each, and fetches figures by dimension: inflation, population, house prices, rents and more. Not every dataset supports observations. A call with a dimension missing lists the valid codes.

Coverage
UK
Endpoint
pubmcp.uk/mcp/ons

CPIH, January 2015 to January 2026. January 2026: 139.4.

One rule per month, January 2015 to January 2026. The line across is 2015 = 100.

Add Office for National Statistics to your assistant

Use the endpoint https://pubmcp.uk/mcp/ons in any MCP client that speaks streamable HTTP.

Claude Code In a terminal

claude mcp add --transport http \
  pubmcp-ons https://pubmcp.uk/mcp/ons

Claude.ai Settings, Connectors, add a custom connector

https://pubmcp.uk/mcp/ons

Cursor ~/.cursor/mcp.json

{
  "mcpServers": {
    "pubmcp-ons": {
      "url": "https://pubmcp.uk/mcp/ons"
    }
  }
}

VS Code .vscode/mcp.json

{
  "servers": {
    "pubmcp-ons": {
      "type": "http",
      "url": "https://pubmcp.uk/mcp/ons"
    }
  }
}

3 tools, each with a real call

Examples captured from the live server on 22/11/2026. Lists are cut to three items and long text is shortened. Ask again for today's figures.

get_dataset_latest

Latest version of an ONS dataset

Get the latest edition and version of an ONS dataset: release date, dimensions (for get_observation), download links and any ONS notices.

Parameters for get_dataset_latest
ParameterType Required Description
dataset_id string Yes id from search_datasets

Example call

{
  "name": "get_dataset_latest",
  "arguments": {
    "dataset_id": "cpih01"
  }
}

Answer

Consumer Prices Index including owner occupiers' housing costs (CPIH): edition time-series, version 67, released 2026-02-18.

{
"alerts": [
"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 publis…"
],
"description": "CPIH is the most comprehensive measure of inflation. It extends CPI to include a measure of the costs associated with owning, maintaining and living in one's ow…",
"dimensions": [
{
"label": "Time",
"name": "time"
},
{
"label": "Geography",
"name": "geography"
},
{
"label": "Aggregate",
"name": "aggregate"
}
],
"downloads": [
{
"format": "csv",
"size_bytes": "4702653",
"url": "https://download.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/67.csv"
},
{
"format": "csvw",
"size_bytes": "1600",
"url": "https://download.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/67.csv-metadata.json"
},
{
"format": "xls",
"size_bytes": "285345",
"url": "https://download.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/67.xlsx"
}
],
"edition": "time-series",
"id": "cpih01",
"next_release": "To be announced",
"release_date": "2026-02-18",
"release_frequency": "Monthly",
"title": "Consumer Prices Index including owner occupiers' housing costs (CPIH)",
"unit": "Index: 2015=100",
"usage_notes": [],
"version": 67
}

get_observation

Get ONS observations

Get data points from an ONS dataset. Arguments: dataset_id (from search_datasets); dimensions, an object mapping each dimension name listed by get_dataset_latest to one option code, or * for exactly one dimension to get all its values (newest first for time); optional edition and version, given together; optional limit (default 20, max 100). A call with a dimension missing lists valid codes. Not every dataset supports observations.

Parameters for get_observation
ParameterType Required Description
dataset_id string Yes id from search_datasets
dimensions object Yes code per dimension, or *
edition string No with version
limit integer No default 20, max 100
version integer No with edition

Example call

{
  "name": "get_observation",
  "arguments": {
    "dataset_id": "cpih01",
    "dimensions": {
      "aggregate": "CP00",
      "geography": "K02000001",
      "time": "*"
    },
    "limit": 3
  }
}

Answer

cpih01 v67: 457 observations (Index: 2015=100); showing 3.

{
"dataset": "cpih01",
"edition": "time-series",
"observations": [
{
"dimensions": {
"Time": "Jan-26"
},
"value": "139.4"
},
{
"dimensions": {
"Time": "Dec-25"
},
"value": "139.9"
},
{
"dimensions": {
"Time": "Nov-25"
},
"value": "139.4"
}
],
"total": 457,
"unit": "Index: 2015=100",
"version": 67
}

search_datasets

Search ONS datasets

Search the ONS dataset catalogue by words. Every word must appear in the dataset id, title, description or keywords; title matches rank first. Returns dataset ids for get_dataset_latest and get_observation.

Parameters for search_datasets
ParameterType Required Description
query string Yes words to find in dataset titles
limit integer No default 20, max 100

Example call

{
  "name": "search_datasets",
  "arguments": {
    "limit": 3,
    "query": "inflation"
  }
}

Answer

3 ONS datasets match "inflation"; showing 3.

{
"datasets": [
{
"description": "CPIH is the most comprehensive measure of inflation. It extends CPI to include a measure of the costs associated with owning, maintaining and living in one's ow…",
"id": "cpih01",
"keywords": [
"Inflation"
],
"last_updated": "2026-02-18",
"national_statistic": true,
"release_frequency": "Monthly",
"title": "Consumer Prices Index including owner occupiers' housing costs (CPIH)"
},
{
"description": "The effects of direct and indirect taxation and benefits received in cash or kind on household income, across the generations and by age. This data is estimated…",
"id": "generational-income",
"keywords": [
"taxes",
"benefits,generational income"
],
"last_updated": "2022-09-15",
"national_statistic": false,
"release_frequency": "Annual",
"title": "Generational income: The effects of taxes and benefits"
},
{
"description": "An experimental price index tracking the prices paid for renting property from private landlords in the United Kingdom",
"id": "index-private-housing-rental-prices",
"keywords": [
"private renting",
"regions,IPHRP,rent,inflation"
],
"last_updated": "2024-02-14",
"national_statistic": false,
"release_frequency": "Monthly",
"title": "Index of Private Housing Rental Prices"
}
],
"total": 3
}

Attribution

Every answer from this server carries this line:

Contains public sector information licensed under the Open Government Licence v3.0. Source: Office for National Statistics.

Open Government Licence v3.0