Skip to main content

TransitResponse

data_quality object

How far a transit answer can be trusted. Always present. Clients must not present notional timing as a departure time or as live data.

verificationstringrequired

Possible values: [historical, unverified, community_reported, field_verified, operator_verified]

timing_basisstringrequired

Possible values: [none, notional, frequency_estimate, operator_timetable]

sourcestringrequired
Example: World Bank Accra GTFS (CC BY 4.0)
as_ofstringrequired

Collection date of the underlying data (YYYY-MM).

Example: 2015-06
notestring
no_transitboolean

Nothing in itineraries uses a vehicle (an empty list included).

notestring

Explanation, present only alongside no_transit.

first_trip object

The earliest or latest scheduled run near the start point, set only when a no-service result fell outside the day's service window and the data is a real operator timetable. Never set for survey-only data, whose single recorded runs say nothing about when service really starts or ends.

short_namestring
Example: 102B
long_namestring
stop_namestring
timestring
Example: 19:40
last_trip object

The earliest or latest scheduled run near the start point, set only when a no-service result fell outside the day's service window and the data is a real operator timetable. Never set for survey-only data, whose single recorded runs say nothing about when service really starts or ends.

short_namestring
Example: 102B
long_namestring
stop_namestring
timestring
Example: 19:40
out_of_coverageboolean

An endpoint lies outside the area the loaded feed covers (Greater Accra), so transit was not attempted. no_transit is also true.

itineraries object[]
  • Array [
  • start_timeinteger

    Unix seconds of the first departure.

    end_timeinteger

    Unix seconds of the final arrival.

    duration_snumber<double>

    Total trip duration in seconds.

    walk_distance_mnumber<double>
    transfersinteger
    legs object[]
  • Array [
  • modestring

    "WALK" | "BUS" | other OTP2 transit modes.

    Example: BUS
    start_timeinteger

    Unix seconds this leg starts.

    end_timeinteger

    Unix seconds this leg ends.

    duration_snumber<double>
    distance_mnumber<double>
    from_namestring

    Boarding stop (or origin for walk legs).

    Example: Ritz
    from_latnumber<double>
    from_lngnumber<double>
    to_namestring
    Example: Achimota Hospital
    to_latnumber<double>
    to_lngnumber<double>
    route_short_namestring
    Example: 081B
    route_long_namestring
    Example: Adenta Station to Achimota Station
    headsignstring
    geometrynumber[][]

    Decoded leg path as [lng, lat] pairs (OTP2 legGeometry, 5-digit precision polyline). Present on walk and ride legs; absent when the source gave none (clients may fall back to a straight line between from/to).

    Possible values: >= 2, <= 2

    stops object[]

    Intermediate stops along a transit ride (walk legs have none).

  • Array [
  • namestring
    Example: St Mary
    latnumber<double>
    lngnumber<double>
  • ]
  • ]
  • ]
  • countinteger
    Example: 2
    TransitResponse
    {
    "data_quality": {
    "verification": "historical",
    "timing_basis": "none",
    "source": "World Bank Accra GTFS (CC BY 4.0)",
    "as_of": "2015-06",
    "note": "string"
    },
    "no_transit": true,
    "note": "string",
    "first_trip": {
    "short_name": "102B",
    "long_name": "string",
    "stop_name": "string",
    "time": "19:40"
    },
    "last_trip": {
    "short_name": "102B",
    "long_name": "string",
    "stop_name": "string",
    "time": "19:40"
    },
    "out_of_coverage": true,
    "itineraries": [
    {
    "start_time": 0,
    "end_time": 0,
    "duration_s": 0,
    "walk_distance_m": 0,
    "transfers": 0,
    "legs": [
    {
    "mode": "BUS",
    "start_time": 0,
    "end_time": 0,
    "duration_s": 0,
    "distance_m": 0,
    "from_name": "Ritz",
    "from_lat": 0,
    "from_lng": 0,
    "to_name": "Achimota Hospital",
    "to_lat": 0,
    "to_lng": 0,
    "route_short_name": "081B",
    "route_long_name": "Adenta Station to Achimota Station",
    "headsign": "string",
    "geometry": [
    0
    ],
    "stops": [
    {
    "name": "St Mary",
    "lat": 0,
    "lng": 0
    }
    ]
    }
    ]
    }
    ],
    "count": 2
    }