BYTETOOLS

CKAN (data.gov.uk) API

Free CKAN API with no key: search and download thousands of government open datasets. The same API powers data.gov.uk and hundreds of portals. Tested example.

No API key requiredHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the CKAN (data.gov.uk) API?

CKAN is the open-source data portal software behind data.gov.uk and hundreds of other government open data catalogues. Its API is free and key-free for reading, letting you search datasets and retrieve their metadata and download URLs.

Learning the CKAN API is unusually good value, because the same endpoints work across hundreds of portals worldwide — data.gov.uk, many EU national portals, and countless city and research catalogues all run CKAN.

The pattern is consistent: `/api/3/action/<action>` with actions like `package_list`, `package_search` and `package_show`. Once you can query one CKAN instance you can query them all by swapping the hostname.

Quick facts

Base URL
https://ckan.publishing.service.gov.uk/api/3/action
Authentication
No key needed for reading public datasets. Writing requires an API token.
Rate limit
Varies by instance; no published limit on data.gov.uk.
Pricing
Free open data, licence varies per dataset.
CORS
Not enabled — call it from your server
Official docs
Read the docs

How to use the CKAN (data.gov.uk) API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. List available datasets

GET https://ckan.publishing.service.gov.uk/api/3/action/package_list

curl
curl 'https://ckan.publishing.service.gov.uk/api/3/action/package_list'
JavaScript (fetch)
const res = await fetch("https://ckan.publishing.service.gov.uk/api/3/action/package_list");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://ckan.publishing.service.gov.uk/api/3/action/package_list", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "help": "https://ckan.publishing.service.gov.uk/api/3/action/help_show?name=package_list",
  "success": true,
  "result": [
    "0-1-annual-probability-extents14",
    "0-1-annual-probability-extents-with-30-climate-change-adjustment15",
    "0-1-annual-probability-outputs13",
    "0-1-annual-probability-outputs-with-30-climate-change-adjustment16",
    "02p-expenditure-over-25k-apr-19",
    "02p-expenditure-over-25k-apr-20",
    "02p-expenditure-over-25k-apr-21",
    "02p-expenditure-over-25k-aug-20",
    "02p-expenditure-over-25k-aug-21",
    "02p-expenditure-over-25k-dec-20",
    "02p-expenditure-over-25k-dec-21",
    "02p-expenditure-over-25k-feb-20",
    "02p-expenditure-over-25k-feb-21",
    "02p-expenditure-over-25k-feb-22",
    "02p-expenditure-over-25k-jan-21",
    "02p-expenditure-over-25k-jul-20a",
    "02p-expenditure-over-25k-jul-21",
    "02p-expenditure-over-25k-jun-20",
    "02p-expenditure-over-25k-jun-21",
    "02p-expenditure-over-25k-jun-22",
    "02p-expenditure-over-25k-jun-22a",
    "02p-expenditure-over-25k-mar-19",
    "02p-expenditure-over-25k-mar-20",
    "02p-expenditure-over-25k-mar-21",
    "02p-expenditure-over-25k-mar-22",
    "02p-expenditure-over-25k-may-20",
    "02p-expenditure-over-25k-may-21",
    "02p-expenditure-over-25k-may-22",
    "02p-expenditure-over-25k-nov-19",
    "02p-expenditure-over-25k-nov-20",
    "02p-expenditure-over-25k-nov-21",
    "02p-expenditure-over-25k-oct-20",
    "02p-expenditure-over-25k-oct-21",
    "02p-expenditure-over-25k-sep-19",
    "02p-expenditure-over-25k-sep-20",
    "02p-expenditure-over-25k-sep

Parameters

ParameterTypeRequiredDescription
qstringOptionalSearch query on package_search. flood
rowsintegerOptionalResults per page on package_search. 10
startintegerOptionalPagination offset. 20
idstringOptionalDataset id or name on package_show. flood-map
fqstringOptionalSolr-style filter query for faceted filtering. res_format:CSV

Response fields

successboolean
Whether the action succeeded — check before reading `result`.
resultarray|object
The payload; shape depends on the action called.
result.results[].titlestring
Dataset title on package_search.
result.results[].resourcesarray
Downloadable files with format and direct URL.
result.countinteger
Total datasets matching a search.

What you can build with the CKAN (data.gov.uk) API

  • Search government open data catalogues programmatically
  • Build a cross-portal dataset search by swapping the hostname
  • Automate discovery and download of CSV datasets for analysis
  • Monitor a catalogue for newly published datasets

Common errors and how to fix them

success: false

The action failed; the error object explains why.

Fix: Check `success` before reading `result` — CKAN returns HTTP 200 for many logical failures.

404 on package_show

Unknown dataset id.

Fix: Use the exact `name` from package_list or package_search, not the display title.

Huge package_list response

Some portals list tens of thousands of datasets.

Fix: Prefer package_search with `rows` over package_list for anything interactive.

CKAN (data.gov.uk) API — frequently asked questions

What is CKAN?

It is the open-source data portal platform behind data.gov.uk and hundreds of other government and research open data catalogues. Learning its API once lets you query all of them.

Does the CKAN API need an API key?

Not for reading public datasets. An API token is only required for creating or editing datasets.

How do I search rather than list everything?

Use /api/3/action/package_search with a `q` parameter and `rows` for page size. package_list returns every dataset name and can be enormous.

Can I use the same code against other CKAN portals?

Yes — that is the main advantage. Swap the hostname and the same action endpoints work, though available datasets and licences differ per portal.

Tools that pair with this API

CKAN (data.gov.uk) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.