SDMX-REST Data Queries

Note

Additional information about how to build SDMX-REST queries can be found in the following tutorial:

Build SDMX-REST data queries.

class pysdmx.api.qb.data.DataContext(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

The context of the data query.

class pysdmx.api.qb.data.DataFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

The SDMX Data formats.

class pysdmx.api.qb.data.DataQuery(context: DataContext = DataContext.ALL, agency_id: str | Sequence[str] = '*', resource_id: str | Sequence[str] = '*', version: str | Sequence[str] = '*', key: str | Sequence[str] = '*', components: MultiFilter | None | NumberFilter | TextFilter = None, updated_after: datetime | None = None, first_n_obs: int | None = None, last_n_obs: int | None = None, obs_dimension: str | None = None, attributes: str | Sequence[str] = 'dsd', measures: str | Sequence[str] = 'all', include_history: bool = False)

A data query.

Data queries allow retrieving statistical data.

context

The context for which data must be retrieved.

agency_id

The agency maintaining the context to be considered.

resource_id

The id of the context to be considered.

version

The version of the context to be considered.

key

The combination of dimension values identifying the slice of the cube for which data should be returned. Wildcarding is supported via the * operator.

components

The component values to be used for data filtering.

updated_after

The last time the query was performed by the client.

first_n_obs

The maximum number of observations to be returned for each of the matching series, starting from the first observation.

last_n_obs

The maximum number of observations to be returned for each of the matching series, counting back from the most recent observation.

obs_dim

The ID of the dimension to be attached at the observation level.

attributes

The attributes to be returned. Possible options are: dsd (all the attributes defined in the DSD), msd (all the reference metadata attributes), dataset (all the attributes attached to the dataset-level), series (all the attributes attached to the series-level), obs (all the attributes attached to the observation-level), all (all attributes), none (no attributes), {attribute_id}: The ID of the one or more attributes to be returned.

measures

The measures to be returned. Possible options are: all (all measures), none (no measure), {measure_id}: The ID of the one or more measures to be returned.

include_history

Retrieve previous versions of the data, as they were disseminated in the past.