ons API for agents (unofficial) — JSON over curl | clify
Office for National Statistics (ons.gov.uk), the UK's official statistics site. This CLI searches publications and data, reads time series values and metadata, bulletins, datasets and the release calendar, and downloads CSV data. It is read-only and needs no login.
Host: ons.gov.uk. Call these verified read commands with plain curl; no install, key, or account. Use the public JSON API with plain curl. No install, key, account, or browser is needed. Example: curl 'https://clify-dev.netlify.app/sites.json'. Start with /search?q=weather, then call /abc/COMMAND. Responses are one JSON object. The hosted MCP and GitHub repo are also available.
Commands
search
Site-wide keyword search over ONS publications, bulletins, time series and datasets, with content-type and census topic filters, sorting and paging Params: q*, filter, topics, sort, page
curl 'https://clify-dev.netlify.app/ons/search?q=inflation&filter=time_series'
search-timeseries
Search the time series explorer (58k+ series) by keyword and/or topic path; each result shows the series ID (CDID) and dataset ID Params: q, topic, sort, page
curl 'https://clify-dev.netlify.app/ons/search-timeseries?q=unemployment'
get-timeseries
Get time series metadata and its latest value (title, CDID, unit, latest period and value, release dates, source dataset) from the ONS content API Params: topic*, series_id*, dataset*
curl 'https://clify-dev.netlify.app/ons/get-timeseries'
get-timeseries-data
Get the monthly observations of a time series as a list of {date, value} (for quarterly or annual-only series use download-timeseries-csv) Params: topic*, series_id*, dataset*
curl 'https://clify-dev.netlify.app/ons/get-timeseries-data'
download-timeseries-csv
Download a time series as CSV with all frequencies (annual, quarterly, monthly) plus metadata rows; also works for a previous version Params: uri*
curl 'https://clify-dev.netlify.app/ons/download-timeseries-csv?uri=%2Feconomy%2Finflationandpriceindices%2Ftimeseries%2Fl55o%2Fmm23'
list-timeseries-versions
List previous (superseded) versions of a time series with update date, label/reason and version uri (pass uri to download-timeseries-csv) Params: topic*, series_id*, dataset*
curl 'https://clify-dev.netlify.app/ons/list-timeseries-versions'
get-bulletin
Get a statistical bulletin edition: title, summary, release and next-release dates, and its sections Params: topic*, series*, edition*
curl 'https://clify-dev.netlify.app/ons/get-bulletin'
list-bulletin-releases
List all past editions of a bulletin series, newest first Params: topic*, series*, page
curl 'https://clify-dev.netlify.app/ons/list-bulletin-releases'
list-bulletin-related-data
List the datasets and data related to a bulletin edition Params: topic*, series*, edition*
curl 'https://clify-dev.netlify.app/ons/list-bulletin-related-data'
get-dataset
Get a dataset page: title, description, release info, any correction notice and the current edition's file download link Params: topic*, dataset*
curl 'https://clify-dev.netlify.app/ons/get-dataset'
list-topic-data
List all published data (time series, datasets, user-requested data) for a topic, with keyword filter, sorting and paging Params: topic*, filter, q, sort, page
curl 'https://clify-dev.netlify.app/ons/list-topic-data?filter=datasets&sort=release_date'
list-topic-publications
List all publications (bulletins, articles and so on) for a topic, with keyword filter, sorting and paging Params: topic*, q, sort, page
curl 'https://clify-dev.netlify.app/ons/list-topic-publications'
list-topic-headline-series
List a topic page's headline (spotlight) time series uris, e.g. CPIH/CPI/RPI for inflation Params: topic*
curl 'https://clify-dev.netlify.app/ons/list-topic-headline-series'
list-releases
List the release calendar (published, upcoming or cancelled releases) with keyword search, sorting and paging, read from the RSS feed Params: keywords, release_type, sort, api_limit, page
curl 'https://clify-dev.netlify.app/ons/list-releases?keywords=gdp&release_type=type-upcoming&sort=date-oldest'
get-release
Get a release calendar entry: title, release date and time, publication status and summary Params: slug*
curl 'https://clify-dev.netlify.app/ons/get-release'