Transit API (Preview) (4.0.0)

Download OpenAPI specification:

⚠️ You are viewing v4 (Preview). View the stable v3 API here.

API provided by data from transit.app

/v4/public/nearby_routes

Returns routes around a location

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

Latitude

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

Longitude

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

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

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

should_update_realtime
boolean
Default: true

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

max_num_departures
integer [ 1 .. 10 ]
Default: 3

Number of departures to return per merged itinerary

time
integer
Example: time=1641024000

Optional epoch timestamp for getting routes at a specific time. If not provided, current time is used.

include_stops_and_shapes
boolean
Default: false

Boolean to control whether stops and shapes are included in itineraries. When false, only itinerary metadata is returned without stops and shape polylines, reducing response size.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/nearby_stops

Returns stops around a location

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

Latitude

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

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.'

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/stop_departures

Get upcoming departures for all routes serving one or more stops, with optional real time information

Authorizations:
apiKey
query Parameters
global_stop_ids
required
string
Example: global_stop_ids=1:82774,2:54321,1:99999

Comma-separated list of global stop IDs to get departures for multiple stops at once. Must contain at most 1000 valid stop IDs. Either this parameter or global_stop_id must be provided.

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

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

should_update_realtime
boolean
Default: true

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

max_num_departures
integer [ 1 .. 10 ]
Default: 3

Number of departures to return per merged itinerary

include_stops_and_shapes
boolean
Default: false

Boolean to control whether stops and shapes are included in itineraries. When false, only itinerary metadata is returned without stops and shape polylines, reducing response size.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/public/estimate_plan_duration

This endpoint returns an estimated duration for a trip plan based on the provided origin and destination.

The query params used in this endpoint are the same as /public/plan, except for the more limited mode selection, real time not available and multiple results aren't provided.

Authorizations:
apiKey
query Parameters
from_lat
number

Latitude of the starting location for the trip. Required unless from_global_stop_id is provided.

from_lon
number

Longitude of the starting location for the trip. Required unless from_global_stop_id is provided.

from_global_stop_id
string

Global stop ID for the starting location. Alternative to from_lat/from_lon parameters.

to_lat
number

Latitude of the destination location for the trip. Required unless to_global_stop_id is provided.

to_lon
number

Longitude of the destination location for the trip. Required unless to_global_stop_id is provided.

to_global_stop_id
string

Global stop ID for the destination location. Alternative to to_lat/to_lon parameters.

mode
string
Default: "transit"
Enum: "transit" "microtransit"

The primary mode of transportation for the trip

secondary_mode
string
Value: "microtransit"

The secondary mode of transportation for the trip, if applicable

leave_time
number

UNIX timestamp representing the desired departure time for the trip

arrival_time
number

UNIX timestamp representing the desired arrival time for the trip

accessibility_need
string
Default: "none"
Enum: "none" "strict" "prioritize_step_free"

This parameter specifies accessibility requirements for the trip. The following values are available:

  • none: No specific accessibility needs are required; any valid trip may be returned.
  • strict: Returns only strictly accessible trips. Specifically, this includes only trips using accessible stops and accessible routes/vehicles.
  • prioritize_step_free: Prioritizes strictly accessible results but also includes less accessible alternatives (those with unknown or non-step-free accessibility).
walk_reluctance
number

A factor that determines how much walking costly compared to riding in a transit vehicle in the trip plan. Values lower than 1.0 will be ignored. Transit uses the value of 1.1 by default and 2.1 when in the "Minimize Walking" mode.

max_distance_between_location_and_stop
number

The maximum distance allowed between the starting or destination locations and a transit stop. This value can be adjusted to optimize performance by limiting the search radius. This value can only be customized if mode=transit, and the default is 1500m.

Responses

Response samples

Content type
application/json
{
  • "duration": 0,
  • "type": "string"
}

/public/plan

This endpoint returns a plan from the origin to the destination in different modes, including multimodal trips.

This endpoint will eventually replace the /otp/plan. The OTP endpoint is deprecated as the OpenTripPlanner endpoint it's based on is also deprecated.

Authorizations:
apiKey
query Parameters
from_lat
number <double>

Latitude of the starting location for the trip. Required unless from_global_stop_id is provided.

from_lon
number <double>

Longitude of the starting location for the trip. Required unless from_global_stop_id is provided.

from_global_stop_id
string

Global stop ID for the starting location. Alternative to from_lat/from_lon parameters.

to_lat
number <double>

Latitude of the destination location for the trip. Required unless to_global_stop_id is provided.

to_lon
number <double>

Longitude of the destination location for the trip. Required unless to_global_stop_id is provided.

to_global_stop_id
string

Global stop ID for the destination location. Alternative to to_lat/to_lon parameters.

mode
string
Default: "transit"
Enum: "transit" "microtransit" "personal_bike" "walk" "shared_mobility"

The primary mode of transportation for the trip

secondary_mode
string
Enum: "microtransit" "personal_bike" "walk" "shared_mobility"

This specifies the secondary mode of transportation for the trip, if applicable.

This value allows for creating multimodal trips mixing transit and another mode. If a value other than walk is specified here, primary_mode must be set to transit.

When this value is set, the planner attempts to replace the first and last legs of the trip with the specified mode if advantageous to do so. If it is not advantageous, a walk leg might be used instead.

Note that the results generated are optimal given the specified modes, but they might not represent the absolute optimal trip overall. Depending on the context, it may be advantageous to compare the result of the multimodal plan against a direct plan (using only the primary mode) to ensure true optimality (i.e., a transit + microtransit result should likely be disregarded if the transit-only plan is faster).

sharing_system_type
string
Default: "docked_bikeshare"
Enum: "docked_bikeshare" "dockless_bikeshare" "scooters"

Specifies the type of shared mobility system when mode is set to shared_mobility.

  • docked_bikeshare: Traditional docked bikeshare systems
  • dockless_bikeshare: Dockless bikes
  • scooters: Electric scooters

If not specified, defaults to docked_bikeshare only.

leave_time
number

UNIX timestamp representing the desired departure time for the trip. If both arrival_time and leave_time are provided, only leave_time is taken into account. By default, the current time is used.

arrival_time
number

UNIX timestamp representing the desired arrival time for the trip. If both arrival_time and leave_time are provided, only leave_time is taken into account.

accessibility_need
string
Default: "none"
Enum: "none" "strict" "prioritize_step_free"

This parameter specifies accessibility requirements for the trip. The following values are available:

  • none: No specific accessibility needs are required; any valid trip may be returned.
  • strict: Returns only strictly accessible trips. Specifically, this includes only trips using accessible stops and accessible routes/vehicles.
  • prioritize_step_free: Prioritizes strictly accessible results but also includes less accessible alternatives (those with unknown or non-step-free accessibility).
walk_reluctance
number

This factor determines how costly walking is compared to riding in a transit vehicle within the trip plan. Values lower than 1.0 will be ignored. Transit, the app, uses a default value of 1.1, and 2.1 when the "Minimize Walking" mode is active.

walk_speed
number [ 0.5 .. 5 ]

The walking speed in meters per second for trip planning calculations. Must be between 0.5 and 5.0 m/s.

should_include_directions
boolean
Default: false

Set to true to get step-by-step directions in the plan results.

max_distance_between_location_and_stop
number

This is the maximum distance allowed between the starting or destination locations and a transit stop. This value can be adjusted to optimize performance by limiting the search radius. By default, the value depends on the selected mode; for example, it is 1500 m for a standard mode=transit plan.

should_update_realtime
boolean
Default: false

If true, the server will update the trip times in the response using real-time data, enhancing the schedule items with real time information. This happens after the initial route planning, which is still based on static schedule data.

consider_downtimes
boolean
Default: false

If true, the planning will avoid any known downtimes identified in the service alerts. For example, if a subway is currently not working and has a severe service alert, the planner will offer results that work around that disruption. This parameter is ignored if the mode is set to anything other than transit.

avoid_routes
string

Comma-separated list of route identifiers to avoid in public transit routing. Each route identifier is a colon-separated pair of <feed_code>:<global_route_id>. This parameter is ignored if the mode is set to anything other than transit.

avoid_stops
string

Comma-separated list of stop identifiers to avoid in public transit routing. Each stop identifier is a colon-separated pair of <feed_code>:<stable_stop_id>. This parameter is ignored if the mode is set to anything other than transit.

allowed_modes
string

Comma-separated list of mode names to allow in public transit routing (e.g., "Bus,Metro,Train"). If specified, only routes with matching mode names will be considered for trip planning. Mode names should match the mode_name field returned in the route object. This parameter is ignored if the mode is set to anything other than transit.

num_result
number
Default: 3

Number of results to return. This parameter is only considered for public transit only plans (mode=transit). Default is 3 for public transit only and bike plans, and 1 for walk plans.

disable_walk_on_multimodal_fallback
boolean
Default: false

If true, disables the automatic walk fallback in multimodal trip planning. When enabled, the planner will only use the specified multimodal mode (e.g., bike, car) and only fallback to walking if no stops are accessible in the multimodal mode. This provides more control over transportation mode preferences in multimodal planning. This parameter only affects multimodal transit trips and is ignored for other modes.

max_num_departures
integer [ 1 .. 10 ]
Default: 3

Number of departures to return per stop

max_num_legs
integer [ 1 .. 6 ]
Default: 3

Maximum number of public transit legs (rides) in the trip plan. This parameter can be used to limit the complexity of the trip by restricting the number of transfers. Default is 3. Values outside the accepted range of 1 to 6 will be silently clamped, except for 0 which will use the default.

soft_timeout
number

Soft timeout for routing, in milliseconds. Once an optimal routing result is found AND this timeout is reached, the router will stop the search for suboptimal results.

Responses

Response samples

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

/map_layers/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.526168

Latitude

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

Longitude

distance
integer <int32> <= 2000
Default: 100

Distance in meters (as the bird flies).

Responses

Response samples

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

/v4/public/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.

country_code
string

Optional country code (ISO 3166-1 alpha-2 format, e.g., "US", "CA") to filter networks to only those available in the specified country.

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.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

Content type
application/json
No sample

/map_layers/available_networks

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

Authorizations:
apiKey

Responses

Response samples

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

/v4/public/route_details

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.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/routes_for_networks

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.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/stops_for_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.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/alerts_for_networks

Return all active service alerts affecting routes in the specified networks. Each alert includes detailed information about affected routes, stops, and trips.

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

List of comma separated 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.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/latest_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
}

/v4/public/search_stops

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.

max_distance
integer >= 0

Optional maximum distance in meters from the search coordinates (lat, lon) to filter results. Only stops within this distance will be returned. If not provided, no distance filtering is applied.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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

/v4/public/trip_details

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.

locale
string
Example: locale=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. If the locale parameter is not provided, the Accept-Language header will be used as a fallback.

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. This header is used as a fallback when the locale query parameter is not specified.

Responses

Response samples

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