get_sdmx_vector_data
Retrieve time-series observations for a known Statistics Canada vector ID via SDMX. Filter by date range or last N observations to get exactly the periods you need.
Instructions
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_from_cube_pid_coord or get_cube_metadata 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 rows contain: dimension values, "period", "value", SCALAR_FACTOR, UOM, VECTOR_ID, STATUS, and other SDMX attributes.
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). |