Transit API (3.0.0)

Download OpenAPI specification:Download

API provided by data from transit.app

Public transport

Get transit routes which are near a location

Returns routes around a location

Authorizations:
apiKey
query Parameters
lat
required
number <double>
Example: lat=45.526168077787894

Latitude

lon
required
number <double>
Example: lon=-73.59506067289408

Longitude

max_distance
integer <= 1500
Default: 150
Example: max_distance=1500

Maximum radius of search from the request location (in meters)

should_update_realtime
boolean
Default: true

Boolean telling the system if it should update real time or just return schedule information.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "routes": [
    ]
}

Get transit stops which are near a location

Returns stops around a location

Authorizations:
apiKey
query Parameters
lat
required
number <double>
Example: lat=45.526168077787894

Latitude

lon
required
number <double>
Example: lon=-73.59506067289408

Longitude

max_distance
integer <= 1500
Default: 150
Example: max_distance=1500

Maximum radius of search from the request location (in meters)

stop_filter
string
Default: "Routable"
Enum: "Routable" "EntrancesAndStopsOutsideStations" "Entrances" "Any"
Example: stop_filter=Routable

Determines which location types from the GTFS are included in the response.

  • Routable (GTFS location_type 0): Stops which are served by routes
  • EntrancesAndStopsOutsideStations: Entrances to transit stations and freestanding outdoor stops
  • Entrances (GTFS location_type 2): Entrances to stations
  • Any: All stops
pickup_dropoff_filter
string
Enum: "PickupAllowedOnly" "DropoffAllowedOnly" "Everything"

For routable stops, futher filter based on whether a rider can embark or disembark at this stop.

  • PickupAllowedOnly: Riders can board at this stop on at least one trip.
  • DropoffAllowedOnly: Riders can exit at this stop on at least one trip.
  • Everything: All stops.

For further reference, see the GTFS pickup_type and drop_off_type fields.'

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "stops": [
    ]
}

Get upcoming departures for all routes serving a stop

Get upcoming departures for all routes serving a stop, with optional real time information.

Authorizations:
apiKey
query Parameters
global_stop_id
required
string
Example: global_stop_id=1:82774

A global stop ID, representing a routable stop. Usually this value will be reused from a previous call (ex : nearby_stops)

time
number <int>
Default: "The current time when the request was issued"

UNIX timestamp representing the time for which departures should be determined

remove_cancelled
boolean
Default: false

Remove cancelled schedule items from the results

should_update_realtime
boolean
Default: true

Boolean telling the system if it should update real time or just return schedule information.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "route_departures": [
    ]
}

Plan a trip from origin to destination

Except as noted, the API is compatible with the OpenTripPlanner API. For additional information, you may refer to http://dev.opentripplanner.org/apidoc/2.0.0/resource_PlannerResource.html.

Authorizations:
apiKey
query Parameters
arriveBy
boolean
Default: false

Selects 'leave after' or 'arrive by' planning.

Case Description
false Trip departs after date and time.
true Trip arrives before date and time.
date
string <%Y-%m-%d>
Default: "Current time when request was issued."
Example: date=2021-01-29

Date of departure or arrival. Must be in UTC.

time
string <%H:%M>
Default: "Current time when request was issued."
Example: time=20:45

Time of departure or arrival. Must be in UTC.

mode
string
Default: "TRANSIT,WALK"
Example: mode=TRANSIT,BICYCLE_RENT

The following combinations of mode are currently supported.

1st Mode 2nd Mode Description
TRANSIT WALK Use transit only. (default)
BICYCLE (none) Use personal bike only.
WALK (none) Walk only.
MICROTRANSIT (none) Use on-demand public transit services only.
TRANSIT BICYCLE_FirstLeg or BICYCLE Use personal bike for first leg, transit for rest of trip.
TRANSIT BICYCLE_LastLeg Use personal bike for last leg, transit for rest of trip.
TRANSIT BICYCLE_FirstAndLastLegs Use personal bike for the first and last legs of trip, transit for the remaining legs.
TRANSIT BICYCLE_RENT Use bikeshare for the first and last legs of trip, transit for the remaining legs. Docked and dockless bikes, as well as scooters are included.
TRANSIT BICYCLE_RENT_Bikeshare Use docked bikes for first and last legs of trip.
TRANSIT BICYCLE_RENT_DocklessBikes Use dockless bikes for the first and last legs of trip.
TRANSIT BICYLCE_RENT_ElectricScooter Use scooters for the first and last legs of trip.
TRANSIT MICROTRANSIT Use on-demand public transit services for the first and last legs of the trip, and scheduled services for the remaining legs.
fromPlace
required
string
Example: fromPlace=45.51487167249841, -73.56092863046088

Originating location for the trip.

  • Simple lat/lon pair (e.g. 40.714476,-74.005966)
  • Lat/lon pair with label (e.g. 289 Broadway::40.714476,-74.005966)
numItineraries
integer <int32> [ 1 .. 3 ]
Default: 3

The maximum number of possible itineraries to return.

toPlace
required
string
Example: toPlace=45.526168077787894,-73.59506067289408

Destination location for the trip.

  • Simple lat/lon pair (e.g. 40.714476,-74.005966)
  • Lat/lon pair with label (e.g. 289 Broadway::40.714476,-74.005966)
locale
string
Default: "en"

Language to be used for names in response

walkReluctance
number
Default: 2

Walking is minimized if walkReluctance ≥ 20.0.

wheelchair
boolean
Default: false

Whether the trip must be wheelchair accessible.

ignoreRealTimeUpdates
boolean
Default: false

If false, times within trip plans reflect real-time information if available.

allowedNetworks
string
Example: allowedNetworks=MBTA|Boston,RIPTA|Providence

If set, only the specified networks will be used to plan trips. A list of available networks can be obtained from /public/available_networks.

This parameter will accept a comma-separated list containing network IDs, network locations or a combination of both. Provides similar functionality to the OTP parameter whitelistedAgencies.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "plan": {
    },
  • "transfers": {
    }
}

Get a list of available networks

List of networks available in the entire Transit system. For more information about networks, refer to the /public/stop_departures endpoint and the 'route_network_name'. Optionnaly, a lat/lon can be passed to filter networks to only the ones that support that coordinate.

Authorizations:
apiKey
query Parameters
lat
number

Optional latitude, if provided in addition to lon the network returned will only include networks serving that location.

lon
number

Optional longitude, if provided in addition to lat the network returned will only include networks serving that location.

include_all_networks
boolean
Default: false

Include additional supported networks that are filtered out by default. For example, these may include school busses and previews of upcoming agency network redesigns.

include_network_geometry
boolean
Default: "true"

Include the network geometry in the response. True by default.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "networks": [
    ]
}

Get detail for a route

Get detailed information like shape and itineraries for a route

Authorizations:
apiKey
query Parameters
global_route_id
required
string

Global route id provided by other endpoint on which more detail is requested.

include_next_departure
boolean
Default: false

If set to true, will make the stop list include the next departure for each stop.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "itineraries": [
    ],
  • "route": {
    }
}

Routes for a given network Deprecated

Return all the routes for a given network. Deprecated, use routes_for_networks instead. This call will be removed on 2025-03-01.

Authorizations:
apiKey
query Parameters
network_id
string
Example: network_id=BC Transit West Kootenay|West Kootenay

Network ID or Network Location provided from /public/available_networks

lat
number

Any lat of a location that serves that network. If provided, the performance of this call will be improved.

lon
number

Any lon of a location that serves that network. If provided, the performance of this call will be improved.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "routes": [
    ]
}

Routes for a given network

Return all the routes for a list of given networks.

Authorizations:
apiKey
query Parameters
network_ids
string
Example: network_ids=BC Transit West Kootenay|West Kootenay

List of comma seperated Network IDs provided from /public/available_networks

lat
number

Any lat of a location that serves that network. If provided, the performance of this call will be improved.

lon
number

Any lon of a location that serves that network. If provided, the performance of this call will be improved.

include_itineraries
boolean

If set to true, the response will include itineraries detail for the listed routes.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "routes": [
    ]
}

Stops for a given network

Return all the stops for a given network.

Authorizations:
apiKey
query Parameters
network_id
string
Example: network_id=BC Transit West Kootenay|West Kootenay

Network ID or Network Location provided from /public/available_networks

lat
number

Any lat of a location that serves that network. If provided, the performance of this call will be improved.

lon
number

Any lon of a location that serves that network. If provided, the performance of this call will be improved.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "stops": [
    ]
}

Latest data update for network

Return the time of the most recent data update for a given network ID or network location

Authorizations:
apiKey
query Parameters
network_id
string
Example: network_id=BC Transit West Kootenay|West Kootenay

Network ID or Network Location provided from /public/available_networks

lat
number

Any lat of a location that serves that network. If provided, the performance of this call will be improved.

lon
number

Any lon of a location that serves that network. If provided, the performance of this call will be improved.

Responses

Response samples

Content type
application/json
{
  • "time": 0
}

Find transit stops by search term

Given coordinates of an approximate area to search, find transit stops whose names or stop codes match the given search term, from feeds which serve the search area.

Authorizations:
apiKey
query Parameters
lat
number

Latitude of the approximate area of the search.

lon
number

Longitude of the approximate area of the search.

query
string

Search term. Will be matched against the stop_name and stop_code of potential stops from the GTFS.

pickup_dropoff_filter
string
Enum: "PickupAllowedOnly" "DropoffAllowedOnly" "Everything"

For routable stops, futher filter based on whether a rider can embark or disembark at this stop.

  • PickupAllowedOnly: Riders can board at this stop on at least one trip.
  • DropoffAllowedOnly: Riders can exit at this stop on at least one trip.
  • Everything: All stops.

For further reference, see the GTFS pickup_type and drop_off_type fields.'

max_num_results
integer [ 1 .. 50 ]

Maximum number of results to return. If there are few matches, less results than requested will be returned.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Get details for a trip.

Provides scheduled times and stop information for an entire trip

Authorizations:
apiKey
query Parameters
trip_search_key
required
string

A trip identifier obtained from other endpoints like /v3/public/stop_departures. This value will frequently change as feeds are updated and should be refetched regularly before use in further requests.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "route": {
    },
  • "rt_trip_id": "string",
  • "schedule_items": [
    ]
}

Shared mobility

Plan a trip from origin to destination

Except as noted, the API is compatible with the OpenTripPlanner API. For additional information, you may refer to http://dev.opentripplanner.org/apidoc/2.0.0/resource_PlannerResource.html.

Authorizations:
apiKey
query Parameters
arriveBy
boolean
Default: false

Selects 'leave after' or 'arrive by' planning.

Case Description
false Trip departs after date and time.
true Trip arrives before date and time.
date
string <%Y-%m-%d>
Default: "Current time when request was issued."
Example: date=2021-01-29

Date of departure or arrival. Must be in UTC.

time
string <%H:%M>
Default: "Current time when request was issued."
Example: time=20:45

Time of departure or arrival. Must be in UTC.

mode
string
Default: "TRANSIT,WALK"
Example: mode=TRANSIT,BICYCLE_RENT

The following combinations of mode are currently supported.

1st Mode 2nd Mode Description
TRANSIT WALK Use transit only. (default)
BICYCLE (none) Use personal bike only.
WALK (none) Walk only.
MICROTRANSIT (none) Use on-demand public transit services only.
TRANSIT BICYCLE_FirstLeg or BICYCLE Use personal bike for first leg, transit for rest of trip.
TRANSIT BICYCLE_LastLeg Use personal bike for last leg, transit for rest of trip.
TRANSIT BICYCLE_FirstAndLastLegs Use personal bike for the first and last legs of trip, transit for the remaining legs.
TRANSIT BICYCLE_RENT Use bikeshare for the first and last legs of trip, transit for the remaining legs. Docked and dockless bikes, as well as scooters are included.
TRANSIT BICYCLE_RENT_Bikeshare Use docked bikes for first and last legs of trip.
TRANSIT BICYCLE_RENT_DocklessBikes Use dockless bikes for the first and last legs of trip.
TRANSIT BICYLCE_RENT_ElectricScooter Use scooters for the first and last legs of trip.
TRANSIT MICROTRANSIT Use on-demand public transit services for the first and last legs of the trip, and scheduled services for the remaining legs.
fromPlace
required
string
Example: fromPlace=45.51487167249841, -73.56092863046088

Originating location for the trip.

  • Simple lat/lon pair (e.g. 40.714476,-74.005966)
  • Lat/lon pair with label (e.g. 289 Broadway::40.714476,-74.005966)
numItineraries
integer <int32> [ 1 .. 3 ]
Default: 3

The maximum number of possible itineraries to return.

toPlace
required
string
Example: toPlace=45.526168077787894,-73.59506067289408

Destination location for the trip.

  • Simple lat/lon pair (e.g. 40.714476,-74.005966)
  • Lat/lon pair with label (e.g. 289 Broadway::40.714476,-74.005966)
locale
string
Default: "en"

Language to be used for names in response

walkReluctance
number
Default: 2

Walking is minimized if walkReluctance ≥ 20.0.

wheelchair
boolean
Default: false

Whether the trip must be wheelchair accessible.

ignoreRealTimeUpdates
boolean
Default: false

If false, times within trip plans reflect real-time information if available.

allowedNetworks
string
Example: allowedNetworks=MBTA|Boston,RIPTA|Providence

If set, only the specified networks will be used to plan trips. A list of available networks can be obtained from /public/available_networks.

This parameter will accept a comma-separated list containing network IDs, network locations or a combination of both. Provides similar functionality to the OTP parameter whitelistedAgencies.

header Parameters
Accept-Language
string
Example: fr,en

Names and other strings can translated into any of the supported languages of a feed. If not provided, the default language of the feed is selected.

Responses

Response samples

Content type
application/json
{
  • "plan": {
    },
  • "transfers": {
    }
}

Get a list of placemarks

Returns placemarks for a location. Placemarks include bikeshare system docks, scooters and other shared systems.

Authorizations:
apiKey
query Parameters
lat
required
number <double>
Example: lat=45.526168077787894

Latitude

lon
required
number <double>
Example: lon=-73.59506067289408

Longitude

distance
integer <int32> <= 2000
Default: 100

Distance in meters (as the bird flies).

Responses

Response samples

Content type
application/json
{
  • "placemarks": [
    ]
}

Get a list of available sharing system networks

List of sharing system networks available in the entire Transit system.

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{
  • "networks": [
    ]
}