UK Data Service open data API
The open data API is a combination of discovery (what is available) which returns metadata, and requests for data, which may return general time series statistics or more focussed (hot topic) aggregations.
Live Documentation
You can try out the open data API without writing any code by going to the Active Documents. You need to enter a user key (which you get with your account when you sign up) or you can try this user key 2fea68f66a3c89baf4b712bbd43bd9a7 which can be used for a limited number of hits per day, after that it cannot be used again until the next day.
General Format
{Version}
and {Resource}
are mandatory. The rest are optional, but ordering must be as shown. /{Version}/{Resource}/{DatasetCode}/{Scope}/{ScopeValue}
- List Datasets
- Dataset Details
- Dataset Topics
- Dataset Keywords
- Dataset Variables
- Dataset Variable Groups
- Dataset Topic Details
- Dataset Keyword Details
- Dataset Variable Details
- Dataset Variable Group Details
- Timeseries Frequency Data
- Timeseries Average Data
- Breakdown Average
- Breakdown Frequency
List Datasets
Return list of datasets for specified datasetType. For the UK Data Service open data API, the type is 'Open'
Format
/{Version}/{Resource}?datasetType={DatasetType}
Example
/v1/Datasets?datasetType=Open
Dataset Details
Return all metadata for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}
Example
/v1/Datasets/EQLS
Dataset Topics
Return all topics for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}
Example
/v1/Datasets/EQLS/Topics
Dataset Keywords
Return all keywords for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}
Example
/v1/Datasets/EQLS/Keywords
Dataset Variables
Return all variables for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}
Example
/v1/Datasets/EQLS/Variables
Dataset Variable Groups
Return all variable Groups for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}
Example
/v1/Datasets/EQLS/VariableGroups
Dataset Topic Details
Return details of specified topic for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}/{Keyword}
Example
/v1/Datasets/EQLS/Topics/EqlsTopic1
Dataset Keyword Details
Return details of specified keyword for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}/{Keyword}
Example
/v1/Datasets/EQLS/Keywords/EqlsKeyword1
Dataset Variable Details
Return details of specified variable for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}/{Variable}
Example
/v1/Datasets/EQLS/Variables/EqlsVariable1
Dataset Variable Group Details
Return details of specified variable group for specified dataset.
Format
/{Version}/{Resource}/{DatasetCode}/{Scope}/{VariableGroup}
Example
/v1/Datasets/EQLS/VariableGroups/EqlsVariableGroup1
Timeseries Frequency Data
Return a time series of one variable, filtered by combinations of other variables.
Parameters
StartYear and EndYear: limit the time series window. Variable: the variable to average over time.
Filters
A combination of filters, constructed as a '|' separated list in the following style: VAR1:1,2,3|VAR2:1,2,3|VAR3:1,2,3 etc.
Format
/{Version}/{Resource}/{DatasetCode}/timeseriesfrequency?StartYear=DateYear&EndYear=DateYear&VariableId=VAR1&Filter=VAR1:1,2,3|VAR2:1,2,3|VARN:1,2,3
Example
/V1/Datasets/EQLS/TimeseriesFrequency?StartYear=2007&EndYear=2007&Variableid=4&Filter=2:27,61|3:1
Timeseries Average Data
Return a time series average of one variable, filtered by combinations of other variables.
Parameters
StartYear and EndYear: limit the time series window. Variable: the variable to average over time.
Filters
A combination of filters, constructed as a '|' separated list in the following style: VAR1:1,2,3|VAR2:1,2,3|VAR3:1,2,3 etc.
Format
/{Version}/{Resource}/{DatasetCode}/timeseriesaverage?StartYear=DateYear&EndYear=DateYear&VariableId=VAR1&filter=VAR1:1,2,3|VAR2:1,2,3|VARN:1,2,3
Example
/v1/Datasets/EQLS/TimeseriesAverage?StartYear=2007&EndYear=2007&variableId=67&filter=15:4|2:6
Breakdown Average
Breakdown (EQLS data is limited to the years 2007 and 2011).
Parameters
StartYear and EndYear: limit the time series window. Variable: the variable Id to average over time. Breakdown: The breakdown variable Id
Filters
A combination of filters, constructed as a '|' separated list in the following style: VAR1:1,2,3|VAR2:1,2,3|VAR3:1,2,3 etc.
Format
/{Version}/{Resource}/{DatasetCode}/BreakdownAverage?StartYear=DateYear&EndYear=DateYear&VariableId=VAR1&BreakdownId=VAR2&filter=VAR1:1,2,3|VAR2:1,2,3|VARN:1,2,3
Example
V1/datasets/eqls/BreakdownAverage?startYear=2007&endYear=2011&variableId=67&breakdownId=45&filter=15:4|2:6
Breakdown Frequency
Breakdown (EQLS data is limited to the years 2007 and 2011).
Parameters
StartYear and EndYear: limit the time series window.
Variable: the variable Id to average over time.
Breakdown ID: The breakdown variable Id
Filters
A combination of filters, constructed as a '|' separated list in the following style: VAR1:1,2,3|VAR2:1,2,3|VAR3:1,2,3 etc.
Format
/{Version}/{Resource}/{DatasetCode}/BreakdownFrequency?StartYear=DateYear&EndYear=DateYear&VariableId=VAR1&BreakdownId=VAR2&filter=VAR1:1,2,3|VAR2:1,2,3|VARN:1,2,3
Example
V1/datasets/eqls/BreakdownFrequency?startYear=2007&endYear=2011&variableId=67&breakdownId=45&filter=15:4|2:6