Child pages
  • API SDMX 2.1 - data query

It is important to remember that only the last version of each statistical observation is made available in the system. When a statistical observation is being updated, the previous value of the observation is lost and cannot be returned.

Depending on the request, a data query can result in a (potentially very) large response in which case data is delivered asynchronously. For more information please read the page 'API getting started' for the section about ASYNC endpoint

This is the SDMX 2.1 REST request for data:

https://<api_base_uri>/sdmx/2.1/<resource>/<flowRef>/<key>/<parameters>

where

Parameter

Description

api_base_uri

See definition of api_base_uri

resource

Following resource is supported: data

flowRef

The identifier of the dataflow reference.
Perform a data discovery metadata query for all dataflows to get the list of dataflow references.

Optional

Description

key

The key in the query is constructed as a dot ('.') separated list of dimension filtered values.
See also Data filtering on dimension

parameters

Multiple parameters can be combined by means of '&' character.


Format
format=<value>
To get responses in other format than SDMX-ML 2.1 Generic, wich is supported by default.
Supported values are:
SDMX_2.1_STRUCTURED for SDMX-ML 2.1 Structure Specific Data
SDMX-CSV for SDMX-CSV flat format
JSON for JSON-stat
TSV for Tab Separated Value


Data filtering on time
startPeriod=<value>&endPeriod=<value>
See also data filtering on time


Data filtering on first N and last N observations
firstNObservations=<value>&lastNObservations=<value>
See also data filtering on first N and last N observations


Details
detail=<value>
To get responses with details.
Supported values are:
dataonly for each series, only the observations are returned, no attributes are returned
serieskeysonly for each series, only the series key are returned, no data or attributes are returned
nodata for each series, only the series level attributes are returned
See also data details


Compression
compressed=true
To get responses in .gz compressed format

SDMX 2.1 endpoint - REST - SDMX-ML 2.1 Generic Data

Retrieving data in SDMX-ML Generic Data format using REST from the SDMX 2.1 endpoint.

Usually, in any SDMX REST Data query, there is a parameter dimensionAtObservation, which can have one of those two values:

  • TIME_PERIOD: This will return a timeseries view of the data, i.e. pivoted (cross-sectional) data.

  • AllDimensions: This will return a "flat" view of the data, with no groupings.

However, this API automatically sets dimensionAtObservation on TIME_PERIOD. Then, if it is necessary to get the data in a flat format, one should use the SDMX-CSV format available in the API.

SDMX 2.1 endpoint - REST - SDMX-ML 2.1 Structure Specific Data

The Structure Specific schema is the preferable option for processing of large amounts of data.

Retrieving data in SDMX-ML Structure Specific Data format using REST from the SDMX 2.1 endpoint.

Usually, in any SDMX REST Data query, there is a parameter dimensionAtObservation, which can have one of those two values:

  • TIME_PERIOD: This will return a timeseries view of the data, i.e. pivoted (cross-sectional) data.

  • AllDimensions: This will return a "flat" view of the data, with no groupings.

However, this API automatically sets dimensionAtObservation on TIME_PERIOD. Then, if it is necessary to get the data in a flat format, one should use the SDMX-CSV format available in the API.

SDMX 2.1 endpoint - REST - SDMX-CSV Data

In SDMX-CSV, the response contains the data displayed in a flat format. It includes codes, and not labels, for dimensions positions. The labels equivalent to codes can be resolved by requesting the dataflow or data structure definition with references resolution.

Retrieving data in SDMX-CSV format using REST from the SDMX 2.1 endpoint.

SDMX 2.1 endpoint - REST - JSON-stat Data

In JSON-stat, the response includes labels, and not codes, for dimensions positions

It is mandatory to specify the language when requesting JSON-stat format for data

Retrieving data in JSON-stat format in English using REST from the SDMX 2.1 endpoint.

SDMX 2.1 endpoint - REST - TSV Data

In TSV, the response includes codes, and not labels, for dimensions positions. The labels equivalent to codes can be resolved by requesting the dataflow or data structure definition with references resolution.

Retrieving data in TSV format using REST from the SDMX 2.1 endpoint.

_