Open Government, New South Wales API

⭐ Beginner's Pick Government / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

The New South Wales (NSW) Government Open Data API provides access to a wide range of public datasets from Australia's most populous state, including transport, environment, and community data. It requires a free API key, making it easy for beginners to get started with government data. Whether you're building civic apps or exploring local datasets, this API offers reliable, structured information.

💡

Beginner Tip

Register for a free API key at api.nsw.gov.au and include it in your request headers as "apikey: YOUR_API_KEY". Start by browsing the API catalogue to find a dataset that interests you.

Available Data

Open Government, New South Wales data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

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

Field Reference

id Unique identifier for the dataset or record.
name Human-readable name of the dataset or resource.
description Brief description of what the dataset contains.
updated ISO 8601 timestamp of when the dataset was last updated.
resources List of downloadable files or API endpoints associated with the dataset.

Implementation Example

const url = "https://api.nsw.gov.au/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
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

401 Unauthorized Missing or invalid API key in the request header.
Ensure you include the header "apikey: YOUR_API_KEY" with a valid key from your NSW API developer account.
404 Not Found The requested dataset endpoint does not exist or has changed.
Browse the NSW API Portal catalogue to find the correct endpoint path for the dataset you want.
429 Too Many Requests You have exceeded the rate limit for your API key.
Slow down your requests and consider caching responses. Check your plan limits in the developer portal.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 2/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Government
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →