Overview

Transport for Auckland (AT) provides real-time public transport data for New Zealand's largest city. You can access bus and train schedules, live vehicle positions, and service alerts through a RESTful API. It's a great starting point for building local transit apps or exploring GTFS-based transport data.

Beginner Tip

Register for a free API key on the AT Developer Portal — most endpoints require an Ocp-Apim-Subscription-Key header. Start with the /gtfs/routes endpoint to list all routes before diving into real-time data.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

match scores and results
team standings
player statistics
schedule and fixtures
Use case: Integrate auckland transport data into web and mobile applications

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "route": "Line 1",
  "origin": "Station A",
  "destination": "Station B",
  "departure": "08:30",
  "arrival": "09:15",
  "status": "On Time",
  "delays_min": 0
}

Field Reference

route_id Unique identifier for a transit route
route_short_name Short public-facing name of the route (e.g., "380")
route_long_name Full descriptive name of the route
route_type GTFS route type code (3 = bus, 2 = rail, etc.)
agency_id ID of the transport agency operating the route

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.at.govt.nz/gtfs/v3/routes";
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

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

401 Unauthorized Missing or invalid Ocp-Apim-Subscription-Key header
Register at dev-portal.at.govt.nz and include your subscription key in the header
429 Too Many Requests Exceeded the rate limit for your subscription tier
Add delays between requests or upgrade to a higher subscription tier
Empty results array Querying a route or stop ID that does not exist
Use the /routes or /stops endpoints first to discover valid IDs

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Transportation
Difficulty Beginner
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →