Stats NZ Datafinder
The Autohive Stats NZ Datafinder integration connects you to the Stats NZ Geographic Data Service via its Koordinates API and WFS web services, enabling:
- Layer discovery - Search public vector layers to find the right dataset, such as census areas or population statistics
- Layer metadata lookup - Retrieve field definitions, data vintage, licence, attribution, and source links needed to cite a layer correctly
- Geographic and attribute querying - Query a layer by polygon, point, bounding box, and/or attribute filters, returning compact attribute records
All operations are read-only.
Install the integration
Log in to Autohive and navigate to Your user profile > Integrations or Your workspace -> Integrations
Locate the Stats NZ Datafinder Integration card and click Connect to workspace

Authenticate - this integration uses a Stats NZ Datafinder API key:
- Sign in (or register) at datafinder.stats.govt.nz
- Create an API key at datafinder.stats.govt.nz/my/api/
- Enable the scopes needed to query layer data through WFS and to read public layer details
Confirm installation - you’ll see “Connected” status displayed
Use the integration
You can now use the integration with your agents, workflows and scheduled tasks!
- Follow our Create your first agent guide on how to create an agent.
- In the ‘Agent settings’, scroll down to the ‘Add Integrations and Agents’ section, click ‘Add integrations and agents’, and select Stats NZ Datafinder. You can choose what individual capabilities to turn on and off.
- Once the settings have been selected, begin prompting the agent with the workflow you’d like to achieve with Autohive and Stats NZ Datafinder!
Available capabilities
Layer Discovery
- Search Layers: Search public vector layers by keyword, returning compact cards (id, title, published date, whether the layer is queryable) so an agent can pick a
layer_idwithout fetching full metadata.
Layer Metadata
- Get Layer Metadata: Return a short description, the non-geometry field list (flagging Census
VAR_*columns ascoded), the count of coded fields, the catalogue page URL, and attachment links (lookup/codebook files) when Datafinder publishes them.
Geographic Querying
- Query Layer: Query a layer by a Polygon/MultiPolygon (area-weighted catchment clip), a Point (containing feature, no area-weighting), a bounding box, and/or attribute filters. Returns compact flat attribute records rather than a GeoJSON FeatureCollection; Census
VAR_*columns are omitted unless explicitly requested viafields.
Key features
Compact, context-friendly results
Query results are flat attribute records rather than full GeoJSON FeatureCollections, and Census VAR_* measure columns are omitted by default (reported as coded_fields_omitted) unless specifically requested - keeping agent context focused on the data actually needed.
Flexible scoping
A query can be scoped with a polygon (catchment or isochrone clip, with area-weighted overlap_fraction), a point (“what area is this in?”), a bounding box, or attribute filters (exact name lookup via ieq) - unscoped national scans are rejected to protect performance.
Citation-ready metadata
Get Layer Metadata returns the data vintage, licence, source attribution, and catalogue page URL needed to properly cite Stats NZ data in downstream reports.
No key leakage, even in errors
Because Datafinder’s WFS API carries the API key in the request path, this integration builds and classifies errors without ever surfacing the key-bearing URL, provider error bodies, or CQL filter text in outputs.
No automatic retries on WFS
WFS calls are made without the SDK’s automatic retry/backoff behaviour (to avoid ever logging a key-bearing URL), so calling workflows should handle their own retry logic for transient WFS failures or rate limits.
Common use cases
Demographic catchment analysis
- Search Layers for a suitable geography, such as “statistical area” or “census”
- Get Layer Metadata to see available fields, including which are Census
VAR_*measures - Query Layer with a catchment polygon (e.g. from an OpenRouteService isochrone) and the specific
fieldsneeded, to get area-weighted population or demographic estimates for the catchment
Named-area lookup
- Search Layers to find a named-geography layer (e.g. SA2 or meshblock boundaries)
- Query Layer using an
attribute_filtersexact match (ieq) on the area name to retrieve its details without needing coordinates
Site and location context
- Query Layer with a Point geometry to identify which statistical area, meshblock, or other named geography a specific coordinate falls within
- Use the result to enrich a location record with official Stats NZ geographic context
Citing official data
- Get Layer Metadata to retrieve licence, attribution, data vintage, and the catalogue page URL for a layer used in a report or analysis
Notes
- Read-only: all Stats NZ Datafinder actions are read-only; no data can be created, updated, or deleted.
- Unscoped queries are rejected: Query Layer requires at least one of a geometry, bounding box, or attribute filter - unscoped national scans are not permitted.
- Census columns are opt-in:
VAR_*Census measure columns are omitted from query results unless listed infieldsorinclude_coded_fieldsis set to true. - Geometry is opt-in: feature geometry is omitted from query results unless
include_geometryis set to true. - No automatic retries on WFS requests: see Key features above.
- Page size limits: Query Layer defaults to 50 records per page (maximum 200) and up to 10 pages by default;
truncatedin the response indicates whether more matching features exist.
Disconnect the integration
Important: Disconnecting removes access to Stats NZ Datafinder from your Autohive workspace.
- Navigate to Your user profile -> Connections or Your workspace -> Integrations
- Find the Stats NZ Datafinder Integration
- Click Disconnect and confirm
Data Impact: Disconnecting stops API access using your stored key but does not affect any data held in the Stats NZ Geographic Data Service or your Datafinder account.
About Stats NZ Datafinder
Stats NZ Datafinder is the New Zealand government’s official Geographic Data Service, operated by Stats NZ - Tatauranga Aotearoa. It provides access to official geographic boundaries, census data, and statistical layers for New Zealand via the Koordinates API and OGC-standard web services (WFS).