get_data
Retrieve actual observations from SDMX dataflows as structured records. Use filters and limits to control the result size, and read the response for truncation and fallback details.
Instructions
Retrieve observations as records. This returns the actual numbers.
Call inspect_dataflow first to confirm component and code IDs and to check the size of what you are about to pull.
If a TIME_PERIOD clause is rejected by the service, it is retried without that clause and the cutoff is applied locally; the response says so in filter_fallback.
Returns: The observations, the filter actually sent, and a truncated flag. When truncated, the rows are the first N in service order and are NOT a representative sample.
Raises: ToolError: If retrieval fails. The message carries a [kind] discriminator and a retry hint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Dataflow reference in agency:id(version) form, such as 'BIS:WS_CBS_PUB(1.0)'. | |
| limit | No | Maximum rows to return. Defaults to 1000, hard ceiling 10000. | |
| labels | No | 'id' returns code IDs (default, and far more compact). 'name' substitutes human-readable names. 'both' gives 'ID: Name'. Leave as 'id' unless names were requested. | id |
| columns | No | Components to return, such as ['OBS_VALUE']. Omit for all. TIME_PERIOD and SERIES_KEY are added automatically by pysdmx. | |
| filters | No | Filter selecting the data, such as "L_MEASURE = 'S' AND L_REP_CTY = 'CH' AND TIME_PERIOD >= '2020-Q1'". AND only, never OR; use IN ('A', 'B') for several values of one component. Omitting this pulls the whole dataflow and will almost certainly truncate. | |
| service | No | Service name or SDMX-REST v2 base URL. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | The resolved dataflow reference. | |
| columns | Yes | ||
| records | Yes | ||
| service | Yes | ||
| next_step | Yes | ||
| row_count | Yes | Rows actually returned. | |
| truncated | Yes | True when total_rows_available exceeded the cap. The returned rows are the first row_count in service order and are NOT a representative sample - narrow the filter for a complete answer. | |
| filter_applied | Yes | The filter actually sent to the service, echoed so the caller can verify what was queried. | |
| filter_fallback | No | Set when server-side time pushdown failed and the time constraint was applied locally instead. Names the filter that was sent and the cutoff applied with pandas. | |
| total_rows_available | Yes | Rows matching the filter before the cap was applied. |