Skip to main content

TransitDeparturesResponse

The onward network from where the rider is standing. When nothing can be boarded here — no stop nearby, or every line ends here — routes is empty, no_routes is true, and note says which.

routes object[]
  • Array [
  • short_namestring
    Example: 263A
    long_namestring
    Example: Darkuman to Haasto
    modestring

    "BUS" or another OTP2 transit mode.

    destinationstring

    Final stop, e.g. "Terminal Haasto".

    dest_latnumber<double>
    dest_lngnumber<double>
    dest_distance_mnumber<double>

    Straight-line distance from the query point to the destination.

    stop_namestring

    Where to board.

    stop_latnumber<double>
    stop_lngnumber<double>
    stop_distance_mnumber<double>

    How far to walk to board.

  • ]
  • countinteger
    Example: 3
    stopsstring[]

    Stop names considered, so a client can say "at Achimota Old Station" rather than repeating coordinates back at the user.

    no_routesboolean

    True when nothing can be boarded here — either no stop within reach, or every line that serves the stop terminates there rather than carrying on. State it rather than leaving the client to infer it from an empty list.

    notestring

    Explains an empty result — "no stop nearby" vs "end of the line".

    TransitDeparturesResponse
    {
    "routes": [
    {
    "short_name": "263A",
    "long_name": "Darkuman to Haasto",
    "mode": "string",
    "destination": "string",
    "dest_lat": 0,
    "dest_lng": 0,
    "dest_distance_m": 0,
    "stop_name": "string",
    "stop_lat": 0,
    "stop_lng": 0,
    "stop_distance_m": 0
    }
    ],
    "count": 3,
    "stops": [
    "string"
    ],
    "no_routes": true,
    "note": "string"
    }