Getting Started

TransitKit wraps the Transport for NSW Trip Planner API into a clean, modern REST API. Get real-time bus departures, nearby stops, and route search with proper JSON responses, CORS support, and real HTTP status codes.


Step 1 — Get an API Key

Register at transitkit.dev/signup. Your key will be emailed instantly. It looks like: tk_live_xxxxxxxxxxxx

Step 2 — Authenticate

Pass your key in the Authorization header:

Authorization: Bearer tk_live_xxxxxxxxxxxx
Note: TransitKit uses standard Bearer auth. The underlying TfNSW API uses a non-standard apikey <jwt> format — TransitKit handles this translation for you.

Step 3 — Make your first request

Terminal
curl https://api.transitkit.dev/v1/departures \
  -H "Authorization: Bearer tk_live_xxxxxxxxxxxx" \
  -G \
  --data-urlencode "stop=200060" \
  --data-urlencode "limit=5"

Response

200 OK
{
  "stop_id": "204210",
  "stop_name": "Newtown Station, King St, Stand B",
  "retrieved_at": "2026-04-03T16:53:00Z",
  "departures": [
    {
      "route": "N10",
      "destination": "Town Hall Station",
      "scheduled_at": "2026-04-03T16:59:00Z",
      "realtime_at": "2026-04-03T17:05:24Z",
      "minutes_away": 6,
      "is_live": true,
      "wheelchair_accessible": true,
      "occupancy": "MANY_SEATS"
    },
    {
      "route": "422",
      "destination": "Strathfield Station",
      "scheduled_at": "2026-04-03T17:04:00Z",
      "realtime_at": null,
      "minutes_away": 11,
      "is_live": false,
      "wheelchair_accessible": true,
      "occupancy": null
    }
  ]
}

Important Notes

Real-time coverage: Coverage varies significantly by stop and time of day. During testing: Newtown Station had ~25% of departures with real-time data, Central Station had ~12%, Circular Quay had ~2.5%. Night buses (N-routes) do receive real-time tracking. TransitKit always indicates is_live accurately.
40 event hard cap: The TfNSW API always returns exactly 40 departure events regardless of query parameters. At busy multi-modal stops like Central, filtering to buses only may leave you with as few as 8 departures. TransitKit's limit parameter works post-filter, so limit=10 always returns 10 buses.
Disruptions: Each departure may include alerts from TfNSW. TransitKit surfaces these as clean plain-text strings in an alerts array — no HTML parsing needed.