Open Government, UK API

Beginner's Pick Government / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)
77 B
Measured Score 0 50 100 Reachability 30/30 Speed 5/20 Security 15/15 Developer XP 12/20 Reliability 15/15 TESTED 2026-07-23

Overview

The UK Open Government Data API (data.gov.uk) is one of the largest government open data portals, exposing thousands of datasets from UK central and local government agencies. It is powered by CKAN and requires no authentication for searching and browsing datasets. A great starting point for civic tech, journalism, or data science projects involving UK public data.

Beginner Tip

Use the CKAN API at data.gov.uk/api/3/action/ to search and retrieve dataset metadata — then follow the resource URLs to download the actual CSV, JSON, or Excel files.

Available Data

Use case: Integrate uk government open data data into web and mobile applications
Open Government, UK data via REST API

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Open Government, UK",
    "description": "UK Government Open Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

success Whether the CKAN action completed successfully
result.results Dataset metadata entries matching your search query
result.count Total number of matching datasets on the portal
result.results[].title Human-readable dataset title
result.results[].resources Downloadable files attached to the dataset including URL, format, and size
result.results[].organization.title The government body that published the dataset

Implementation Example

Request
const url = "https://data.gov.uk/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Resource download URL returns 404 UK government agencies sometimes move or retire hosted files while keeping the metadata entry
Check the dataset page on data.gov.uk for an updated link or contact the publisher listed on the page
datastore_search returns no records Most UK GOV datasets are file-based and not loaded into the CKAN datastore
Download the resource file directly using the URL in the resources[].url field and parse it locally
Slow response on large package_search queries Broad searches without filters can return very large result sets
Add specific filters like fq=res_format:CSV or fq=organization:department-name to narrow results

Measured Score Breakdown

Live HTTP request to the API endpoint

Reachability 30/30
Speed 5/20
Security 15/15
Developer XP 12/20
Reliability 15/15
Endpoint Response Time 2958ms

Fully tested on Jul 23, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Government
Difficulty Beginner
Verified: 2026-04-07

Similar APIs

View All →