ONS UK Statistics Scraper avatar

ONS UK Statistics Scraper

Pricing

from $27.00 / 1,000 results

Go to Apify Store
ONS UK Statistics Scraper

ONS UK Statistics Scraper

Scrapes the ONS Beta API for UK statistics. Returns dataset catalogue, metadata, and observations as flat rows with dimension filters. Export to CSV, JSON, Excel, or XML.

Pricing

from $27.00 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

14 days ago

Last modified

Share

ParseForge

ONS UK Statistics Scraper

Scrape official UK statistics from the ONS Beta API, from the full dataset catalogue to filtered observations. Every row is a flat record with dataset metadata, edition, version, and dimension values. No API key or registration. Export to CSV, JSON, Excel, or XML.

The ONS publishes the UK's official economic and social statistics, but its Beta API returns nested JSON that is hard to flatten and paginate. This Actor reads the public catalogue, dataset metadata, and observation endpoints directly, applies dimension filters as it goes, and returns each record in one fixed schema. It works for CPI, labour market, wellbeing, and every other dataset in the catalogue.

Who uses itWhat they scrape ONS UK Statistics for
Market researchersPull CPI or labour market series for a specific geography and time window.
Data journalistsGet the latest wellbeing or crime figures for a story, with full metadata.
EconomistsBuild a clean time series from ONS observations without writing API code.
Open data developersMirror the ONS catalogue into a local database or data warehouse.

What it does

This Actor collects ONS UK statistics by catalogue, dataset ID, or observation query, and returns each record as a flat row with dataset, edition, version, and dimension values.

  • πŸ“š Catalogue mode: list every dataset in the ONS catalogue, with ID, title, and description.
  • πŸ“„ Dataset mode: fetch metadata, editions, and versions for one dataset or a batch of up to 100 IDs.
  • πŸ“Š Observations mode: pull actual data values from a specific edition and version, with dimension filters.
  • 🧭 Available dimensions mode: list the dimensions and allowed values for a dataset before you query it.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with ONS UK Statistics data

πŸ“ˆ Track inflation over time.

An economist runs observations mode on cpih01 with geography and time filters to build a monthly CPI series for a report.

πŸ—ΊοΈ Compare regional labour markets.

A policy analyst pulls the latest employment data for several UK regions and exports it to Excel for a briefing.

πŸ“° Fact-check a news story.

A journalist fetches the latest wellbeing or crime dataset and checks the official figures before publishing.

πŸ—„οΈ Mirror the ONS catalogue.

An open data developer runs catalogue mode weekly and stores the dataset list in a database for a search interface.

Why choose this scraper

What you get
No API keyThe ONS Beta API is public; this Actor handles the requests and pagination for you.
Flat outputNested JSON is flattened into one row per observation or dataset, ready for CSV or Excel.
Batch lookupsPass up to 100 dataset IDs in one run to fetch metadata for many series at once.
Dimension filteringFilter observations by geography, time, aggregate, and any other dimension with wildcards.

How it compares

No other Store actor targets ONS UK Statistics the same way, so the honest comparison is with the alternatives teams actually weigh.

ONS UK Statistics ScraperBuild it in-houseBy hand
SetupRun it now, zero configDays of engineeringNone, but hours per pull
When ONS UK Statistics changesMaintained for youYou fix itYou re-learn the page
Proxies, retries, anti-botBuilt inYour problemBrowser only
OutputFixed JSON schema, CSV/Excel exportWhatever you buildCopy-paste
CostPay per resultEngineering timeAnalyst hours

Configure the run

Drive the Actor from dataset IDs, edition, version, and dimension filters, and set a maximum number of datasets per run so only the records you need reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
"mode": "catalogue",
"edition": "time-series",
"maxItems": 10
}

A larger pull:

{
"mode": "catalogue",
"edition": "time-series",
"maxItems": 200
}

Pricing

Pay-per-result: $0.036 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$3.60
1,000 results$36.00
10,000 results$360.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the ONS UK Statistics Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to ONS UK Statistics through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/ons-uk-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check that the dataset ID is correct and that the edition and version exist. For observations mode, make sure your dimension filters match allowed values. Run available dimensions mode to see valid options.

Why does the run fail with a 404 error?

The dataset ID, edition, or version may not exist. Verify the ID in catalogue mode and check the dataset's editions and versions in dataset mode.

Why are my dimension filters ignored?

The dimensions input must be a valid JSON object with keys matching the dataset's dimension names. Use available dimensions mode to get the exact names and values.

Why is the run slow?

The ONS API rate limits requests. Reduce maxItems or narrow your dimension filters to fetch fewer records. The Actor respects the API's pagination and retries automatically.

Can I fetch multiple datasets in one run?

Yes, in dataset mode use the datasetIds array to pass up to 100 dataset slugs. For observations, run the Actor once per dataset or use multiple runs.

FAQ

QuestionAnswer
Do I need an API key for the ONS Beta API?No. The ONS Beta API is public and does not require registration or an API key. This Actor makes the requests for you.
How do I find the dataset ID for a statistic?Run the Actor in catalogue mode to list all datasets with their IDs, or use the ONS website to find the slug. Common IDs include cpih01 for CPI and wellbeing-quarterly for wellbeing.
What is the difference between dataset and observations mode?Dataset mode returns metadata about a dataset, including its editions and versions. Observations mode returns the actual data values from a specific edition and version, with optional dimension filters.
Can I filter observations by geography or time?Yes. In observations mode, set the dimensions input to a JSON object like {"geography":"K04000001","time":"*"} to filter by specific values or wildcards.
How many datasets can I fetch in one run?You can set maxItems up to 1,000,000. For dataset mode, you can pass up to 100 dataset IDs in the datasetIds array.
What output formats are supported?The Actor returns data in the Apify dataset, which you can export to CSV, JSON, Excel, or XML from the Apify console or API.
Does this Actor handle pagination?Yes. The Actor automatically follows pagination links from the ONS API until it has collected the requested number of records or reached the end.
Can I get the latest version of a dataset automatically?Yes. Leave the version field empty and the Actor will use the latest version exposed by the dataset.
What is the available dimensions mode for?It lists the dimensions and their allowed values for a dataset, which helps you build the dimensions filter for observations mode.
Is this Actor affiliated with the ONS?No. This is an independent scraper that reads the public ONS Beta API. It is not endorsed by or affiliated with the Office for National Statistics.

Browse the full ParseForge collection for more scrapers.

πŸ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Office for National Statistics. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.