Open Government, New Zealand API

⭐ Beginner's Pick Government / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

The New Zealand Government Open Data API provides free access to datasets published by New Zealand government agencies, covering topics like health, transport, and environmental statistics. No authentication is required, so you can start querying data immediately. It's a great resource for developers exploring open civic data from New Zealand.

💡

Beginner Tip

No API key is needed — just use the CKAN-based REST API directly with standard HTTP GET requests. Try the "/api/3/action/package_list" endpoint first to see all available datasets.

Available Data

Open Government, New Zealand data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Open Government, New Zealand",
    "description": "New Zealand Government Open Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

success Indicates whether the API request was successful.
result Contains the main response data, such as search results or dataset metadata.
count Total number of records matching the query.
results Array of dataset objects matching the search criteria.
name URL-friendly identifier (slug) of the dataset.
title Human-readable title of the dataset.

Implementation Example

const url = "https://www.data.govt.nz/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Empty result set Search query is too specific or uses incorrect field names.
Use broader search terms and consult the CKAN API documentation for supported query parameters.
Connection timeout The server may be under heavy load or temporarily unavailable.
Retry the request after a short delay and implement basic retry logic in your code.
Invalid JSON response The endpoint URL may be malformed or an unsupported action was requested.
Double-check the action name in your URL against the official CKAN API reference.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 2897ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Government
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →