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
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | Required | Origin TfNSW stop ID. Use /v1/stops/search to find IDs. |
| to | string | Required | Destination TfNSW stop ID. |
| date | string | Optional | Date in YYYYMMDD format, Sydney local time. Defaults to today. |
| time | string | Optional | Time in HHmm 24-hour format, Sydney local time. Defaults to now. |
| arrive_by | boolean | Optional | If true, plan journeys arriving by date/time instead of departing at it. Default: false. |
| limit | integer | Optional | Max 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
| Field | Type | Description |
|---|---|---|
| departs_at / arrives_at | string | Planned journey start/end times (UTC ISO 8601) |
| departs_at_realtime / arrives_at_realtime | string | null | Real-time estimates, null when no live data |
| duration_minutes | integer | Total journey duration using best-known times |
| changes | integer | Number of interchanges between transit legs |
| is_live | boolean | Whether any leg has real-time tracking |
| legs | Leg[] | Ordered legs including walking connections |
Leg Fields
| Field | Type | Description |
|---|---|---|
| mode | string | train, metro, lightrail, bus, coach, ferry, schoolbus, or walk |
| route | string | null | Short route name ("T1", "333", "L2"), null for walking legs |
| line_name | string | null | Full line name ("T1 North Shore & Western Line") |
| direction | string | null | Headsign the vehicle displays |
| origin / destination | object | Stop with name, platform, lat/lng, and planned + real-time times |
| stops | integer | Number of intermediate stops on the leg |
| distance_metres | integer | null | Walking distance — only set on walk legs |
| path | [lat, lng][] | Route geometry — render directly as a map polyline |
| alerts | string[] | 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.