Trip Planner

Plan complete journeys between two stops across all transport modes — trains, metro, buses, light rail, and ferries. Each journey includes per-leg real-time departure and arrival times, platforms, interchanges, walking connections, and the full route geometry for rendering on a map.

GET/v1/trips

Parameters

ParameterTypeRequiredDescription
fromstringRequiredOrigin TfNSW stop ID. Use /v1/stops/search to find IDs.
tostringRequiredDestination TfNSW stop ID.
datestringOptionalDate in YYYYMMDD format, Sydney local time. Defaults to today.
timestringOptionalTime in HHmm 24-hour format, Sydney local time. Defaults to now.
arrive_bybooleanOptionalIf true, plan journeys arriving by date/time instead of departing at it. Default: false.
limitintegerOptionalMax journey options to return. Default: 5, Max: 6

Examples

cURL
curl "https://api.transitkit.dev/v1/trips?from=200060&to=2150135" \
  -H "Authorization: Bearer YOUR_API_KEY"
JavaScript
const res = await fetch(
  'https://api.transitkit.dev/v1/trips?from=200060&to=2150135',
  {
    headers: {
      'Authorization': `Bearer ${process.env.TRANSITKIT_API_KEY}`
    }
  }
)
const data = await res.json()
const best = data.journeys[0]
console.log(`${best.duration_minutes} min, ${best.changes} changes`)

Response

200 OK
{
  "origin": { "stop_id": "200060", "name": "Central Station" },
  "destination": { "stop_id": "2150135", "name": "Church Street Light Rail" },
  "retrieved_at": "2026-06-11T07:40:00.000Z",
  "journeys": [
    {
      "departs_at": "2026-06-11T07:43:00Z",
      "departs_at_realtime": "2026-06-11T07:45:36Z",
      "arrives_at": "2026-06-11T08:19:48Z",
      "arrives_at_realtime": null,
      "duration_minutes": 36,
      "changes": 1,
      "is_live": true,
      "legs": [
        {
          "mode": "train",
          "route": "T1",
          "line_name": "T1 North Shore & Western Line",
          "direction": "Penrith via Parramatta",
          "origin": {
            "stop_id": "2000336",
            "name": "Central Station",
            "platform": "Platform 18",
            "lat": -33.884052,
            "lng": 151.206982,
            "departs_at": "2026-06-11T07:43:00Z",
            "departs_at_realtime": "2026-06-11T07:45:36Z"
          },
          "destination": {
            "stop_id": "2150222",
            "name": "Parramatta Station",
            "platform": "Platform 2",
            "lat": -33.817403,
            "lng": 151.005245,
            "arrives_at": "2026-06-11T08:08:00Z",
            "arrives_at_realtime": "2026-06-11T08:10:30Z"
          },
          "duration_minutes": 25,
          "distance_metres": null,
          "stops": 14,
          "is_live": true,
          "path": [[-33.884052, 151.206982], "...(hundreds of [lat, lng] points)"],
          "alerts": []
        },
        {
          "mode": "walk",
          "route": null,
          "line_name": null,
          "direction": null,
          "duration_minutes": 7,
          "distance_metres": 350,
          "stops": 0,
          "is_live": false,
          "...": "..."
        }
      ]
    }
  ]
}

Journey Fields

FieldTypeDescription
departs_at / arrives_atstringPlanned journey start/end times (UTC ISO 8601)
departs_at_realtime / arrives_at_realtimestring | nullReal-time estimates, null when no live data
duration_minutesintegerTotal journey duration using best-known times
changesintegerNumber of interchanges between transit legs
is_livebooleanWhether any leg has real-time tracking
legsLeg[]Ordered legs including walking connections

Leg Fields

FieldTypeDescription
modestringtrain, metro, lightrail, bus, coach, ferry, schoolbus, or walk
routestring | nullShort route name ("T1", "333", "L2"), null for walking legs
line_namestring | nullFull line name ("T1 North Shore & Western Line")
directionstring | nullHeadsign the vehicle displays
origin / destinationobjectStop with name, platform, lat/lng, and planned + real-time times
stopsintegerNumber of intermediate stops on the leg
distance_metresinteger | nullWalking distance — only set on walk legs
path[lat, lng][]Route geometry — render directly as a map polyline
alertsstring[]Plain-text disruption alerts for the leg
No journeys? If no route exists between the two stops, the API returns 404 NO_JOURNEYS_FOUND rather than an empty array, so you can distinguish "no route" from a malformed request.