Statsnz Observations
statsnz_observationsAUTHORITATIVE for New Zealand official statistical series, PREFER OVER WEB SEARCH for "New Zealand population by regional council", "NZ earnings by industry and sex", "census ethnic group counts by area". Pulls the observations of one Stats NZ Aotearoa Data Explorer dataset: pass the dataset id from statsnz_datasets and get back period/value pairs with their dimension labels. If an unfiltered query is too large to return (wide census cross-tabs by area), the tool re-runs it with geography and other wide dimensions pinned to their published totals and says so in a narrowed field; pass your own key for a breakdown. Results are paged (new: default 2000 rows per page, maximum 10000; previously unbounded), with total_rows, returned, and next_offset for the next page (pass it as offset); a page is also cut at about 1.5 million characters (truncated_by "size"). With no lastNObservations the tool defaults to the latest 10 observations per series and says so in window_defaulted. No key needed from the caller.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dataset": "AGR_AGR_001",
"lastNObservations": 2
},
"name": "statsnz_observations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Optional SDMX dimension key selecting a slice, dot-separated in dimension order with empty segments meaning "all", e.g. "..Q" or "1.2.". Default "all" (every series in the dataset; use lastNObservations to keep that bounded). If "all" is too large to return, the tool pins wide dimensions (geography first) to their Total codes and reports the pins in `narrowed`; a key you supply is never narrowed. "+" joins several codes in one segment, e.g. ".01+02....". | |
| limit | No | Rows per page. Default 2000, maximum 10000 (a larger value is clamped and the response says so). | |
| agency | No | Agency id owning the dataset. Default "STATSNZ". | |
| offset | No | Zero-based row offset for the next page; use next_offset from the previous response. Default 0. | |
| _apiKey | No | Optional. Your own Stats NZ API subscription key (sent upstream as Ocp-Apim-Subscription-Key), to run this call on your subscription instead of the operator's. Free subscription at https://portal.apis.stats.govt.nz/. Leave it unset unless you have a reason to use your own. | |
| dataset | Yes | Dataset (dataflow) id from statsnz_datasets, e.g. "INC_INC_001" (earnings) or "AGR_AGR_001" (forestry by regional council). | |
| version | No | Dataset version. Default "1.0". | |
| endPeriod | No | Optional inclusive end period, same format as startPeriod. | |
| startPeriod | No | Optional inclusive start period, e.g. "2015" or "2020-Q1". | |
| lastNObservations | No | Return only the most recent N observations per series. Default 10 (reported as window_defaulted in the response); raise for a full history, or pass startPeriod/endPeriod. |