MfE Data Service
Search the public Ministry for the Environment catalogue on data.mfe.govt.nz and read one layer document. This is catalogue metadata only: titles, field names, feature counts and the layer licence. It does not download features or call a query endpoint.
CLI
python3 skills/mfe-data-service/scripts/cli.py search flood --limit 1 --json
python3 skills/mfe-data-service/scripts/cli.py layer 117733 --json
Commands:
search QUERY [--limit N] [--json]— oneGET /services/api/v1/data/?q=&page_size=N.Nis 1 to 20. The response is one JSON list. Further pages are announced in the HTTPLinkheader withrel="page-next"andrel="page-last"(alsorel="next"/rel="last"). The command does not request the next page.truncatedis true when that next relation is present or the list is longer than--limit. Sort-only relations, including an empty catalogue page, staytruncatedfalse. Same-host targets under/services/api/v1/data/are copied topage.nextandpage.last. Off-host, userinfo, and query-service targets are omitted.layer ID [--json]—GET /services/api/v1/layers/{id}/. Returns field names,feature_countand the licence. A layer is returned only whenlicense.typeiscc-byfor a known Creative Commons Attribution version.
--json prints a meta / results envelope. Search JSON also includes truncated, and page.next / page.last when those Link targets are official catalogue URLs. meta.latest_data is the source published_at timestamp when that value is stated, not the land-use or observation year in a title. meta.licence is set on a layer only after the licence gate passes. Search results omit a catalogue-wide licence because each layer states its own.
When truncated is true, human output includes More catalogue rows exist; this command does not page further.
Exit codes follow docs/contracts.md: 2 invalid input, 4 rate limit or block, 5 timeout or HTTP 5xx, 6 malformed catalogue JSON, 7 closed licence, missing licence, off-host redirect, or unsupported path. An empty search is an empty results array. A missing or non-attribution licence is a refusal, not an assumed Creative Commons Attribution licence.
There is no URL argument. Requests stay on https://data.mfe.govt.nz. Thumbnail and service links inside a document are not requested.
Resources
- CLI:
scripts/cli.py - Contract test:
scripts/test_contract.py - Smoke test:
scripts/smoke_test.py - Source notes:
references/source-notes.md