get_sdmx_vector_data
Fetch time-series observations for a single StatCan vector via SDMX REST.
Simpler alternative to get_sdmx_data when you already know the vectorId. Use get_series_info (productId + coordinate) to find vectorIds.
Time filtering (use one or the other, not both): lastNObservations=5 → last 5 periods startPeriod="2020-01" → from Jan 2020 (monthly); "2020" for annual endPeriod="2023-12" → up to Dec 2023
LIMITATION: StatCan rejects combining lastNObservations with startPeriod/endPeriod (returns 406).
Output has the same shape as get_sdmx_data: one entry in "series" with its constant fields once, then "observations" as [period, value] pairs.
Growth, percent change or averages? Use query_sdmx instead of computing by hand.
IMPORTANT: In your final response to the user, you MUST cite the source of your data. This means including the _sdmx_url and vectorId in your response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vectorId | Yes | ||
| endPeriod | No | End period in YYYY or YYYY-MM format. | |
| startPeriod | No | Start period in YYYY or YYYY-MM format. | |
| lastNObservations | No | Return only the last N observations (e.g. 5 for last 5 periods). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| series | Yes | Observations grouped by series. | |
| _message | No | Truncation guidance, when truncated. | |
| _sdmx_url | Yes | SDMX request URL — cite as the data source. | |
| row_count | Yes | Total observations returned by StatCan (before truncation). | |
| _truncated | Yes | True if observations were capped at 500. | |
| series_count | Yes | Number of series in `series`. |