public

Default ONS query API

Default ONS query API which combines the content with type counts

get/search

Request

  • Base URL
    /v1 (relative, and the document’s source URL is not known)
  • Auth
    none required

Query parameters

qstring required

Query search term.

content_typestring[]

Comma-separated list of content types to be returned.

topicsstring[]

Comma-separated list of topics to be returned.

population_typesstring[]

Comma-separated list of population type names to filter the results (or).

dimensionsstring[]

Comma-separated list of dimension names to filter the results (and).

cdidsstring[]

Comma-separated list of cdids to filter the results (or).

dataset_idsstring[]

Comma-separated list of dataset IDs to filter the results.

highlightboolean

Determines whether to return HTML highlighted fields.

sortstring

The order to return the results.

limitinteger

The number of items requested, defaulted to 10 and limited to 1000.

offsetinteger

The first row of resources to retrieve, starting at 0. Use this parameter as a pagination mechanism along with the limit parameter.

fromDatestring

Specifies candidate results by their ReleaseDate, which must be on or after the fromDate

toDatestring

Specifies candidate results by their ReleaseDate, which must be on or before the toDate

nlp_weightingboolean

Runs query through NLP processors to influence search weighting

uri_prefixstring

URI prefix to filter the search results e.g. /economy

Response

OK

countnumber required

Number of search results which match query

tooknumber required

Time taken to execute query in milliseconds

distinct_items_countinteger required

Count of distinct items that match the query

suggestionsstring[]

List of suggested alternative similar search queries

additional_suggestionsstring[]

List of suggested alternative search queries from current search query

Example response

{
  "count": 80,
  "took": 530,
  "distinct_items_count": 100,
  "items": [
    {
      "language": "English"
    }
  ],
  "additional_suggestions": [
    "UK",
    "economy",
    "inflation rate"
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.