@pipeworx/stats-nz
Connect: https://gateway.pipeworx.io/stats-nz/mcp · Install: one-click buttons
No MCP client? Skip the connection: POST https://gateway.pipeworx.io/v1/tools/search_packs {"query":"..."} to find a tool below, GET /v1/tools/<name> for its schema, POST the same URL with arguments for the data — see For AI agents.
Tools: 3
New Zealand official statistics (Aotearoa Data Explorer) — search Stats NZ’s 911 published datasets by keyword and pull their observations, covering the 2013/2018/2023 censuses, LEED earnings, business demography, population estimates and projections, household expenditure, corrections and justice.
Tools
statsnz_datasets({ query, limit, offset })— keyless. Keyword-search all 911 datasets; returns dataset id, full title, description, agency, version.statsnz_observations({ dataset, key, agency, version, startPeriod, endPeriod, lastNObservations, _apiKey })— period/value pairs with their dimension labels.statsnz_resources({ dataset, agency, version, includeCodes, maxCodesPerList, _apiKey })— dimensions in key order, time dimension, measure, and the code lists that turn a key like1.2.Qinto something readable.
Auth
Split, and the split is the point.
statsnz_datasetsneeds no key at all —/rest/dataflow/all/all/latestanswers with all 911 dataflows anonymously.statsnz_observationsandstatsnz_resourcesrequire an API key:/rest/data/…and/rest/datastructure/…both answer HTTP 401 without one.
Platform key PLATFORM_STATSNZ_KEY with BYO override via ?_apiKey=; sent
upstream as an Ocp-Apim-Subscription-Key header. Free subscription at
https://portal.apis.stats.govt.nz/ — sign up, then subscribe to the Aotearoa
Data Explorer API product.
Data sources
- https://api.data.stats.govt.nz/rest/dataflow/all/all/latest — dataset catalogue (keyless).
- https://api.data.stats.govt.nz/rest/data/{agency},{dataset},{version}/{key} — observations (keyed).
- https://api.data.stats.govt.nz/rest/datastructure/{agency}/{dataset}/{version}?references=all — structure + code lists (keyed).
Traps
- Wrong host looks like an outage. The older documented host
api.stats.govt.nzanswers HTTP 502 from its Azure Application Gateway on every path including the root. A 502 reads as “their service is down” when in fact the service moved. The live host isapi.data.stats.govt.nz. Do not “fix” this pack back to the old hostname. - A bare SDMX resource path 404s.
/rest/dataflowis404 Resource not found; only the fully-qualified/rest/dataflow/{agency}/{resource}/{version}form answers. That 404 is indistinguishable from “this API does not exist”, which is how the keyless catalogue path gets missed. - Only 341 of the 911 dataflows carry a
description; the rest are title-only, so keyword filtering leans on long formal titles (“Earnings for people in paid employment”, never “wages”). - CPI, GDP and merchandise trade are NOT in this catalogue. Measured 2026-09-17: 0 of 911 dataflows mention “price”, “consumer” or “trade”; 705 are census tables. Describing the pack as covering CPI would misroute every inflation question to a source that cannot answer it.
Tools
- statsnz_datasets — Stats NZ datasets matching a keyword, with the ids needed to pull their data.
- statsnz_observations — Observations from one Stats NZ dataset, as period/value pairs.
- statsnz_resources — The dimensions and code lists behind one Stats NZ dataset.
Tools
statsnz_datasets— Stats NZ datasets matching a keyword, with the ids needed to pull their data.statsnz_observations— Observations from one Stats NZ dataset, as period/value pairs.statsnz_resources— The dimensions and code lists behind one Stats NZ dataset.