# New Plymouth District Council GeoHub API

> NPDC GeoHub: 167 datasets with catalogue search and feature layer queries

- Vendor: `newplymouthdistrictcouncilgeoh` · version 1.0 · category Government Data · tags new plymouth api, new plymouth open data api, new plymouth gis data api, arcgis hub api, arcgis feature layer api, government open data api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/newplymouthdistrictcouncilgeoh
- This document: https://apiclay.com/docs/newplymouthdistrictcouncilgeoh.md
- OpenAPI 3.1: https://apiclay.com/api/newplymouthdistrictcouncilgeoh/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `newplymouthdistrictcouncilgeoh`
- Updated: 2026-11-18

## About

## New Plymouth District Council GeoHub API

The open data site of New Plymouth District Council (New Zealand) (geohub.npdc.govt.nz, run on ArcGIS Hub): about 167 datasets, for example district plan zones. Search the catalogue, read one dataset's record (title, description, tags, extent and the `url` of its layer), and query the feature layers published under services2.arcgis.com with filters, field selection, sorting, paging and counts.

Data comes from **geohub.npdc.govt.nz** (https://geohub.npdc.govt.nz). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/datasets?q=parks&amp;limit=5` for an `id` and its layer `url`, then `/query?service=&amp;layer=0&amp;where=1=1&amp;outFields=*&amp;resultRecordCount=10` with the service name and layer number from that `url`.

### Routes

#### GET `/datasets` - Datasets
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| q | query | string | no | Keyword search, e.g. `parks`. |
| limit | query | number | no | Datasets per page (up to 100). |
| startindex | query | number | no | 1-based position of the first result, for paging. |
| sortBy | query | string | no | e.g. `-modified` for newest first. |
| filter | query | string | no | CQL filter, e.g. `type='Feature Service'`. |
| bbox | query | string | no | `minx,miny,maxx,maxy` in longitude and latitude. |

Returns: a GeoJSON FeatureCollection: `numberMatched`, `numberReturned` and `features`, each with `id` and `properties` (`title`, `snippet`, `description`, `type`, `tags`, `modified`, `url`, `license`).

#### GET `/dataset` - Dataset
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | `id` from `/datasets`. |

Returns: one GeoJSON feature whose `properties` include the dataset's layer `url`.

#### GET `/query` - Query
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| service | path | string | yes | Service name: the part of the layer `url` just before `/FeatureServer`, e.g. `OpenData_Strategy_DistrictPlan_PartOperative`. |
| layer | path | number | yes | Layer number after `/FeatureServer/`, usually `0`. |
| where | query | string | yes | SQL filter on the layer's fields; `1=1` for all rows. |
| outFields | query | string | no | `*` or a comma list of field names. |
| returnCountOnly | query | string | no | `true` returns only `{count}`. |
| returnGeometry | query | string | no | `false` drops shapes and keeps attributes. |
| resultRecordCount | query | number | no | Rows per page; each layer has its own cap, often 1,000 or 2,000. |
| resultOffset | query | number | no | Rows to skip, for paging. |
| orderByFields | query | string | no | e.g. `OBJECTID DESC`. |
| outSR | query | string | no | Output coordinates, e.g. `4326` for latitude and longitude. |

Returns: ArcGIS JSON: `fields`, `features` (each with `attributes` and, unless `returnGeometry=false`, `geometry`) and `exceededTransferLimit` when more rows remain; or `{count}` with `returnCountOnly=true`.

### Caveats

- `/query` reaches layers published under https://services2.arcgis.com/JthOmqz8HxPqljUO/arcgis/rest/services; a dataset whose `url` points to another server can't be queried through it, but `/datasets` and `/dataset` still describe it.
- Some datasets name individuals (licence holders, employees, drivers, arrestees) as published by the government; handle them under applicable privacy law.
- Each dataset carries its own licence and terms (`properties.license`); credit New Plymouth District Council (New Zealand).
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by geohub.npdc.govt.nz.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /datasets — Datasets
- Gateway: `GET https://api.apiclay.com/v1/api/newplymouthdistrictcouncilgeoh/datasets`
- Public query params: `q` (string), `limit` (number), `startindex` (number), `sortBy` (string), `filter` (string), `bbox` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /dataset — Dataset
- Gateway: `GET https://api.apiclay.com/v1/api/newplymouthdistrictcouncilgeoh/dataset`
- Public query params: `id` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /query — Query
- Gateway: `GET https://api.apiclay.com/v1/api/newplymouthdistrictcouncilgeoh/query`
- Public query params: `where` (string, required), `outFields` (string), `returnCountOnly` (string), `returnGeometry` (string), `resultRecordCount` (number), `resultOffset` (number), `orderByFields` (string), `outSR` (string), `service` (string, required), `layer` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/newplymouthdistrictcouncilgeoh/datasets" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
