data.gov.uk Datasets Scraper
parseforge/data-gov-uk-scraper
Travel
Scrapes dataset listings from data.gov.uk by search query, topic, publisher, or format. Returns each dataset as a flat row with title, description, publisher, licence, and file URLs.
- Total users
- 9
- Monthly active
- 0
- Total runs
- 310
- Bookmarked
- 0
- Rating
- 5.0 (1)
- Last modified
- 12 days ago
Overview
data.gov.uk Datasets Scraper
Scrape UK government datasets from data.gov.uk by search term, topic, publisher, or format, up to a million per run. Every dataset comes with its title, description, publisher, licence, and direct file links. No API key or registration. Export to CSV, JSON, Excel, or XML.
Finding open data from the UK government means browsing data.gov.uk page by page, or writing code against the CKAN API. This Actor reads the public dataset listings directly. Feed it a search term, a topic like Health or Transport, a publisher name, or a file format, and it returns matching datasets in one fixed schema.
| Who uses it | What they scrape data.gov.uk for |
|---|---|
| Open data researchers | Build a catalogue of all CSV datasets published by a specific government department. |
| Policy analysts | Monitor newly published datasets on a topic like Crime and justice for weekly reports. |
| Data journalists | Find machine-readable data on government spending to support an investigation. |
| Commercial data teams | Pull all GEOJSON mapping files from UK public bodies into a single inventory. |
What it does
This Actor collects dataset listings from data.gov.uk by search query, topic, publisher, format, or direct URL, and returns each one as a flat row.
- π Search by keyword: Filter datasets with a free-text search term like 'economics' or 'air quality'.
- ποΈ Filter by publisher: Narrow results to a specific organisation, such as 'Office for National Statistics'.
- π Filter by topic: Select from official categories including Health, Education, Environment, and Transport.
- π Filter by format: Request only CSV, JSON, GEOJSON, ZIP, or other specific file types.
- π Licence filter: Restrict results to datasets with an Open Government Licence (OGL) only.
- π Sort order: Retrieve results by relevance or by most recently updated.
Results export to CSV, JSON, Excel, or XML, or straight from the API.
What you can do with data.gov.uk data
π Build a departmental data inventory.
A government analyst runs the Actor with publisher set to 'Department for Transport' and format set to 'CSV' to list every machine-readable dataset their department offers.
π° Feed a newsroom data pipeline.
A data journalist scrapes all datasets under the 'Government spending' topic weekly, sorted by recency, to spot new transparency releases.
πΊοΈ Collect UK geospatial data.
A GIS specialist filters by format 'GEOJSON' and 'SHP' across all topics to maintain a master index of UK public mapping data.
π Track open data publication trends.
A researcher runs the Actor monthly with no filters, capturing the full catalogue to measure how many datasets each publisher adds over time.
Why choose this scraper
| What you get | |
|---|---|
| No API key needed | Reads the public data.gov.uk search pages, no registration or OAuth. |
| Fixed flat schema | Every dataset row has the same columns, ready for analysis or a database. |
| Bulk extraction | Pull up to a million datasets in one run on a paid plan. |
| OGL-aware | Option to keep only datasets with the permissive Open Government Licence. |
How it compares
This Actor focuses on data.gov.uk with native topic, publisher, and format filters, while the alternatives below either target different sources or offer broader CKAN portal support.
| Feature | ParseForge | Data.gov.uk Scraper - Low-cost | CKAN Open Data Scraper |
|---|---|---|---|
| Native data.gov.uk topic filter | Yes, 11 official topics | Not listed | Not listed |
| Publisher name filter | Yes | Not listed | Not listed |
| File format filter (CSV, JSON, GEOJSON, etc.) | Yes, 14 formats | Not listed | Not listed |
| Open Government Licence (OGL) filter | Yes | Not listed | Not listed |
| Scrapes any CKAN portal beyond data.gov.uk | No, data.gov.uk only | Not listed | Yes |
| Direct dataset URL input | Yes | Not listed | Not listed |
Configure the run
Drive the Actor from a direct data.gov.uk URL or from search filters like topic, publisher, and format, and filters run as each dataset is read so only matches reach your dataset. The Input tab lists every parameter.
A first run with the defaults:
{
"maxItems": 10,
"searchQuery": "economics",
"sort": "best"
}
A larger pull:
{
"maxItems": 200,
"searchQuery": "economics",
"sort": "best"
}
Pricing
Pay-per-result: $0.075 per result collected. You pay only for the results written to your dataset.
| Results collected | Approximate cost |
|---|---|
| 100 results | $7.50 |
| 1,000 results | $75.00 |
| 10,000 results | $750.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
- Create a free Apify account with $5 in credit.
- Open the data.gov.uk Datasets Scraper.
- Set your inputs and any filters, then click Start.
- 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 data.gov.uk 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/data-gov-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 your search term or publisher name is spelled exactly as it appears on data.gov.uk. Also, try broadening your filters: remove the format or topic filter to see if any datasets match the remaining criteria.
The Actor stops after 10 datasets but I need more.
Free Apify accounts have a limit of 10 items per run. Upgrade to a paid plan and increase the maxItems setting to continue scraping up to 1,000,000 datasets.
I pasted a startUrl but the Actor is ignoring my search filters.
The startUrl and the search filters are mutually exclusive. If you provide a startUrl, the Actor scrapes that URL directly and ignores searchQuery, publisher, topic, and format. Clear the startUrl field to use filters.
The OGL filter is not returning any datasets.
Not all datasets on data.gov.uk carry the Open Government Licence. Try running without the OGL filter first to see what licences are available, then re-run with the filter if OGL datasets exist for your query.
Some datasets show a format I did not filter for.
A single dataset listing can contain multiple resources in different formats. The Actor returns the dataset if any of its resources match your format filter.
FAQ
| Question | Answer |
|---|---|
| Do I need an API key for data.gov.uk? | No. This Actor reads the public search and listing pages. You do not need to register an application or obtain a key. |
| Can I scrape a specific publisher's datasets? | Yes. Use the Publisher filter and enter the exact name, for example 'Office for National Statistics'. The Actor will return only datasets from that organisation. |
| What file formats can I filter by? | You can filter by CSV, ESRI REST, GEOJSON, HTML, JSON, KML, PDF, SHP, WFS, WMS, XLS, XML, ZIP, or Other. Leave the filter empty to get all formats. |
| How do I get only datasets with an Open Government Licence? | Check the 'Open Government Licence (OGL) Only' box in the input. The Actor will drop any dataset that does not carry the OGL. |
| Can I scrape a single dataset page instead of search results? | Yes. Paste the full data.gov.uk dataset URL into the startUrl field. The Actor will extract that one dataset's metadata. |
| What is the maximum number of datasets I can scrape? | Free Apify users are limited to 10 datasets per run. Paid users can set maxItems up to 1,000,000. |
| Does this Actor download the actual data files? | No. It scrapes the dataset listings and returns the metadata plus the direct download URLs. You can use those URLs in another step to fetch the files. |
| Can I sort results by the most recently updated datasets? | Yes. Set the Sort By option to 'recent'. The default is 'best', which sorts by relevance to your search term. |
| What topics are available in the filter? | The full list is Business and economy, Crime and justice, Education, Environment, Government, Government spending, Health, Mapping, Society, Towns and cities, and Transport. |
| Can I combine a search term with a topic filter? | Yes. You can set a searchQuery and a topic at the same time. The Actor will return datasets that match both conditions. |
Related actors
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 data.gov.uk. 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.
Input
| Field | Type | What it does | Default |
|---|---|---|---|
| startUrl | string | Direct URL to scrape from data.gov.uk. Use this OR search filters below, not both. Example: https://www.data.gov.uk/search?q=economics | not set |
| maxItems | integer | Free users: Limited to 100. Paid users: Optional, max 1,000,000 | 10 |
| searchQuery | string | Search term to filter datasets. Use this OR startUrl above, not both. Example: 'economics' | economics |
| publisher | string | Filter by publisher name. Example: 'Office for National Statistics' | not set |
| topic | string (12 options) | Filter by topic. Available: Business and economy, Crime and justice, Education, Environment, Government, Government spending, Health, Mapping, Society, Towns and cities, Transport | not set |
| format | string (15 options) | Filter by data format. Available: CSV, ESRI REST, GEOJSON, HTML, JSON, KML, PDF, SHP, WFS, WMS, XLS, XML, ZIP, Other | not set |
| oglOnly | boolean | Only include datasets with Open Government Licence | false |
| sort | string (2 options) | Sort results by relevance or date | best |
Pricing
from $1.20 per 1,000 results
| Charged for | What it is | Price each |
|---|---|---|
| Actor Start | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). | $0.05 to $0.075 |
| result | Single result in the default dataset. | $0.0012 to $0.0018 |
Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.
API
One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.
curl -X POST "https://api.apify.com/v2/acts/parseforge~data-gov-uk-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"helloWorld": 123
}' Examples
Input that runs as-is.
{
"helloWorld": 123
} Reviews
Rated 5.0 out of 5 across 1 review. Read them on Apify.
Issues
We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.
Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.
