/datasets

GET

Returns a list of all datasets available via the ONS APIs.

Parameters

Name Type Description
is_based_on query A population type to search on to return datasets that are associated with that population type e.g. Usual-Residents. This is applicable to Census 2021 datasets only.
type query A filter to search the datasets by dataset type e.g. type=static
limit query Maximum number of items that will be returned. A value of zero will return zero items.
offset query Starting index of the items array that will be returned. By default it is zero, meaning that the returned items will start from the beginning.
sort_order query Value for the sort order of the array that will be returned. Default value is DESC (z-a) for descending order, for the ascending order ASC can be used.
id query ID that represents a dataset

Responses

200: A json list containing datasets which have been published

Example value
{
  "count": 20,
  "items": [
    {
      "canonical_topic": "7779",
      "collection_id": "666c06bc09d337ab9d164c82f8f383c081a4e38cbd91b79d4a23ea0025fecb3f",
      "contacts": [
        {
          "email": "example@ons.gov.uk",
          "name": "Expert Statistical Team",
          "telephone": "+44 1234 111111"
        }
      ],
      "description": "This dataset contains some very interesting data about the UK.",
      "id": "my-dataset",
      "is_based_on": {
        "id": "Usual-Residents",
        "type": "cantabular_table"
      },
      "keywords": [
        "Inflation"
      ],
      "last_updated": "2025-02-05T17:12:13.877Z",
      "license": "Open Government Licence v3.0",
      "links": {
        "editions": {
          "href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions"
        },
        "latest_edition": {
          "href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017"
        },
        "latest_version": {
          "href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5",
          "id": "5"
        },
        "self": {
          "href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset"
        },
        "taxonomy": {
          "href": "https://www.ons.gov.uk/theme/topic"
        }
      },
      "methodologies": [
        {
          "description": "This is a description of the linked resource.",
          "href": "https://www.ons.gov.uk/my-related-page",
          "title": "Related Link Title"
        }
      ],
      "national_statistic": true,
      "next_release": "To be announced",
      "publications": [
        {
          "description": "This is a description of the linked resource.",
          "href": "https://www.ons.gov.uk/my-related-page",
          "title": "Related Link Title"
        }
      ],
      "publishers": [
        {
          "href": "https://www.ons.gov.uk",
          "name": "Office for National Statistics"
        }
      ],
      "qmi": {
        "href": "https://www.ons.gov.uk/businessindustryandtrade/retailindustry/methodologies/retailsalesindexrsiqmi"
      },
      "related_content": [
        {
          "description": "This is a description of the linked resource.",
          "href": "https://www.ons.gov.uk/my-related-page",
          "title": "Related Link Title"
        }
      ],
      "related_datasets": [
        {
          "description": "This is a description of the linked resource.",
          "href": "https://www.ons.gov.uk/my-related-page",
          "title": "Related Link Title"
        }
      ],
      "release_frequency": "Monthly",
      "state": "published",
      "subtopics": [
        "7755"
      ],
      "survey": "census",
      "title": "Consumer Prices Index",
      "topics": [
        "7779",
        "7755"
      ],
      "type": "static",
      "unit_of_measure": "Number of people"
    }
  ],
  "limit": 20,
  "offset": 0,
  "total_count": 123
}

400: Parameter is_based_on or type was sent but no value was provided

404: No dataset was found with the population-type provided

500: Failed to process the request due to an internal error