/search

GET

Default ONS query API which combines the content with type counts

Parameters

Name Type Description
q query Query search term.
content_type query Comma-separated list of content types to be returned.
topics query Comma-separated list of topics to be returned.
population_types query Comma-separated list of population type names to filter the results (or).
dimensions query Comma-separated list of dimension names to filter the results (and).
cdids query Comma-separated list of cdids to filter the results (or).
dataset_ids query Comma-separated list of dataset IDs to filter the results.
highlight query Determines whether to return HTML highlighted fields.
sort query The order to return the results.
limit query The number of items requested, defaulted to 10 and limited to 1000.
offset query The first row of resources to retrieve, starting at 0. Use this parameter as a pagination mechanism along with the limit parameter.
fromDate query Specifies candidate results by their ReleaseDate, which must be on or after the fromDate
toDate query Specifies candidate results by their ReleaseDate, which must be on or before the toDate
nlp_weighting query Runs query through NLP processors to influence search weighting
uri_prefix query URI prefix to filter the search results e.g. `/economy`

Responses

200: OK

Example value
{
  "additional_suggestions": [
    "UK",
    "economy",
    "inflation rate"
  ],
  "content_types": [
    {
      "count": 0,
      "type": "string"
    }
  ],
  "count": 80,
  "dimensions": [
    {
      "count": 0,
      "type": "string"
    }
  ],
  "distinct_items_count": 100,
  "items": [
    {
      "description": {
        "contact": {
          "email": "string",
          "name": "string",
          "telephone": "string"
        },
        "dataset_id": "string",
        "dimensions": [
          {
            "label": "string",
            "name": "string",
            "raw_label": "string"
          }
        ],
        "edition": "string",
        "headline1": "string",
        "headline2": "string",
        "headline3": "string",
        "highlight": {
          "keywords": [
            "string"
          ],
          "summary": "string",
          "title": "string"
        },
        "keywords": [
          "string"
        ],
        "language": "English",
        "latest_release": true,
        "meta_description": "string",
        "national_statistic": true,
        "next_release": "14 August 2015",
        "population_type": "string",
        "pre_unit": "string",
        "release_date": "2025-02-05T17:12:13.877Z",
        "source": "string",
        "summary": "string",
        "title": "string",
        "topics": [
          "string"
        ],
        "unit": "string"
      },
      "type": "string",
      "uri": "string"
    }
  ],
  "population_type": [
    {
      "count": 0,
      "type": "string"
    }
  ],
  "suggestions": [
    "string"
  ],
  "took": 530,
  "topics": [
    {
      "count": 0,
      "type": "string"
    }
  ]
}

400: Query term not specified

500: Internal server error

POST

Request a new search index and receive the name of the new index created in response. Endpoint requires service or user authentication.

Responses

200: OK

Example value
{
  "index_name": "ons1636458168532"
}

500: Internal server error