Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.
get_api_artifactsOne API's artifacts, grouped by type.
get_openapiThe primary OpenAPI for this API.
find_similar_apisAPIs that look like this one.
apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
resolveTurn a domain, URL or GitHub org into the provider it belongs to.
find_cohortsEvery scored population of providers in the catalog.
All 92 tools →
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/transit:transit-api-v4"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.1.0
info:
title: Transit API (Stable)
version: 4.0.0
x-logo:
url: transit-logotype_iOS-dark.png
contact: {}
description: '**📌 You are viewing v4 (Stable). View the legacy [v3 API here](v3.html).**
API provided by data from [transit.app](https://transit.app). Request an API key
[here](https://transitapp.com/partners/apis).
'
paths:
/v4/public/nearby_routes:
get:
operationId: /v4/public/nearby_routes
description: Returns routes around a location
parameters:
- $ref: '#/components/parameters/Latitude'
- $ref: '#/components/parameters/Longitude'
- in: query
name: max_distance
description: Maximum radius of search from the request location (in meters)
schema:
type: integer
example: 1500
default: 150
maximum: 1500
- $ref: '#/components/parameters/Locale'
- $ref: '#/components/parameters/Accept-Language'
- schema:
type: boolean
default: true
in: query
name: should_update_realtime
description: 'Boolean telling the system if it should update real time or
just return schedule information. '
- in: query
name: merge_platform_stops
description: When true, platform stops of the same station are merged into
a single merged itinerary per direction. When false (default), each platform
stop gets its own merged itinerary.
schema:
type: boolean
default: false
- in: query
name: max_num_departures
description: Number of departures to return per merged itinerary
schema:
type: integer
default: 3
minimum: 1
maximum: 10
- in: query
name: time
description: Optional epoch timestamp for getting routes at a specific time.
If not provided, current time is used.
schema:
type: integer
example: 1641024000
- in: query
name: include_stops_and_shapes
description: 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.
schema:
type: boolean
default: false
- in: query
name: stop_detailed
description: When true, stop objects in `stops` and `detour.skipped_stops`
are returned as `StopDetailed` instead of `Stop`. Only applies when `include_stops_and_shapes=true`.
schema:
type: boolean
default: false
- in: query
name: include_inactive
description: When true, inactive routes, identified by `is_active=false`,
are returned.
schema:
type: boolean
default: false
responses:
'200':
description: List of nearby routes
content:
application/json:
schema:
type: object
properties:
nearby_routes:
type: array
items:
type: object
properties:
alerts:
type: array
description: Service alerts that affect this route
items:
$ref: '#/components/schemas/ServiceAlert'
global_route_id:
$ref: '#/components/schemas/GlobalRouteId'
route_long_name:
type: string
description: Route long name from GTFS
route_short_name:
type: string
description: Route short name from GTFS
route_timezone:
type: string
description: The timezone of the route
route_display_short_name:
$ref: '#/components/schemas/DisplayShortName'
compact_display_short_name:
$ref: '#/components/schemas/DisplayShortName'
fares:
type: array
items:
$ref: '#/components/schemas/Fare'
route_type:
type: integer
description: Route type as defined in GTFS
route_color:
type: string
description: Route color as defined in GTFS
route_text_color:
type: string
description: Route text color as defined in GTFS
route_network_name:
type: string
description: The network name associated with that route
route_network_id:
type: string
description: A global unique identifier for the network
tts_long_name:
type: string
description: Long name for TTS
tts_short_name:
type: string
description: Short name for TTS
sorting_key:
type: string
description: Key for sorting routes
mode_name:
type: string
description: Mode name for the given route
mode_key:
type: string
description: Identifier for the mode of the route. The same
in every language, unlike `mode_name`.
real_time_route_id:
type: string
description: Route id used for real time
vehicle:
$ref: '#/components/schemas/Vehicle'
is_active:
type: boolean
description: Marks whether the route is active or not. Inactive
routes are only included when `include_inactive=true`
is provided.
merged_itineraries:
type: array
description: Array of merged itineraries, each containing
individual itineraries and schedule items
items:
type: object
properties:
direction_id:
type: integer
description: Direction ID
closest_stop:
$ref: '#/components/schemas/Stop'
description: The closest stop for this merged itinerary
itineraries:
type: array
description: Individual itineraries within this merged
itinerary
items:
$ref: '#/components/schemas/ItineraryWithInternalId'
schedule_items:
type: array
description: Schedule items for this merged itinerary,
each referencing an individual itinerary
items:
$ref: '#/components/schemas/ScheduleItemWithInternalId'
required:
- global_route_id
- route_long_name
- route_short_name
- merged_itineraries
'400':
description: Latitude or longitude is invalid or missing
'500':
description: Internal server error causing no result
requestBody:
content: {}
parameters: []
/v4/public/nearby_stops:
get:
operationId: /v4/public/nearby_stops
description: Returns stops around a location
parameters:
- $ref: '#/components/parameters/Latitude'
- $ref: '#/components/parameters/Longitude'
- in: query
name: max_distance
description: Maximum radius of search from the request location (in meters)
schema:
type: integer
example: 1500
default: 150
maximum: 1500
- in: query
name: stop_filter
description: 'Determines which location types from the [GTFS](https://developers.google.com/transit/gtfs/reference#stopstxt)
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
'
schema:
type: string
enum:
- Routable
- EntrancesAndStopsOutsideStations
- Entrances
- Any
example: Routable
default: Routable
- $ref: '#/components/parameters/PickupDropoffFilter'
- in: query
name: stop_detailed
description: When set to `true`, returns `StopDetailed` objects instead of
`Stop` objects, including additional fields like timezone, bike boarding,
network info, and TTS name.
schema:
type: boolean
default: false
- in: query
name: include_beta_feeds
description: When true, includes stops from beta feeds in the response
schema:
type: boolean
default: false
- $ref: '#/components/parameters/Locale'
- $ref: '#/components/parameters/Accept-Language'
responses:
'200':
description: List of nearby stops
content:
application/json:
schema:
type: object
properties:
stops:
type: array
description: Returns `Stop` objects by default, or `StopDetailed`
objects when `stop_detailed=true`.
items:
oneOf:
- $ref: '#/components/schemas/Stop'
- $ref: '#/components/schemas/StopDetailed'
'400':
description: Latitude or longitude is invalid or missing
'500':
description: Internal server error causing no result
parameters: []
/v4/public/stop_departures:
get:
operationId: /v4/public/stop_departures
description: Get upcoming departures for all routes serving one or more stops,
with optional real time information
parameters:
- in: query
name: global_stop_ids
required: true
description: Comma-separated list of global stop IDs to get departures for
multiple stops at once. Must contain at most 100 valid stop IDs. Either
this parameter or global_stop_id must be provided.
schema:
example: 1:82774,2:54321,1:99999
type: string
- in: query
name: time
description: UNIX timestamp representing the time for which departures should
be determined
schema:
type: number
format: int
default: The current time when the request was issued
- in: query
name: remove_cancelled
description: Remove cancelled schedule items from the results
schema:
type: boolean
default: false
- $ref: '#/components/parameters/Locale'
- $ref: '#/components/parameters/Accept-Language'
- schema:
type: boolean
default: true
in: query
name: should_update_realtime
description: 'Boolean telling the system if it should update real time or
just return schedule information. '
- in: query
name: merge_platform_stops
description: When true, platform stops of the same station are merged into
a single merged itinerary per direction. When false (default), each platform
stop gets its own merged itinerary.
schema:
type: boolean
default: false
- in: query
name: max_num_departures
description: Number of departures to return per merged itinerary
schema:
type: integer
default: 3
minimum: 1
maximum: 10
- in: query
name: include_stops_and_shapes
description: 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.
schema:
type: boolean
default: false
- in: query
name: stop_detailed
description: When true, stop objects in `stops` and `detour.skipped_stops`
are returned as `StopDetailed` instead of `Stop`. Only applies when `include_stops_and_shapes=true`.
schema:
type: boolean
default: false
- in: query
name: exclude_terminal_arrivals
description: When true, schedule items where the queried stop is the final
stop of the trip are removed from the results. Such entries are arrivals
at the end of the line — riders cannot ride toward the itinerary headsign
— and normally only appear when the vehicle continues in service as another
trip (e.g. interlined or loop routes); the continuation trip's own departure
is listed separately.
schema:
type: boolean
default: false
responses:
'200':
description: List of upcoming departures at stop, grouped by route, then
by merged itinerary
content:
application/json:
schema:
type: object
properties:
route_departures:
type: array
items:
type: object
properties:
alerts:
type: array
description: Service alerts that affect this route
items:
$ref: '#/components/schemas/ServiceAlert'
global_route_id:
$ref: '#/components/schemas/GlobalRouteId'
route_long_name:
type: string
description: Route long name from GTFS
route_short_name:
type: string
description: Route short name from GTFS
route_timezone:
type: string
description: The timezone of the route
route_display_short_name:
$ref: '#/components/schemas/DisplayShortName'
compact_display_short_name:
$ref: '#/components/schemas/DisplayShortName'
fares:
type: array
items:
$ref: '#/components/schemas/Fare'
route_type:
type: integer
description: Route type as defined in GTFS
route_color:
type: string
description: Route color as defined in GTFS
route_text_color:
type: string
description: Route text color as defined in GTFS
route_network_name:
type: string
description: The network name associated with that route
route_network_id:
type: string
description: A global unique identifier for the network
tts_long_name:
type: string
description: Long name for TTS
tts_short_name:
type: string
description: Short name for TTS
sorting_key:
type: string
description: Key for sorting routes
mode_name:
type: string
description: Mode name for the given route
mode_key:
type: string
description: Identifier for the mode of the route. The same
in every language, unlike `mode_name`.
real_time_route_id:
type: string
description: Route id used for real time
vehicle:
$ref: '#/components/schemas/Vehicle'
merged_itineraries:
type: array
description: Array of merged itineraries, each containing
individual itineraries and schedule items
items:
type: object
properties:
direction_id:
type: integer
description: Direction ID (0 or 1)
closest_stop:
$ref: '#/components/schemas/Stop'
description: The closest stop for this merged itinerary
itineraries:
type: array
description: Individual itineraries within this merged
itinerary
items:
$ref: '#/components/schemas/ItineraryWithInternalId'
schedule_items:
type: array
description: Schedule items for this merged itinerary,
each referencing an individual itinerary
items:
$ref: '#/components/schemas/ScheduleItemWithInternalId'
global_stop_id:
type: string
description: The global stop ID associated with this route
departure
example: STM:88368
required:
- global_route_id
- route_long_name
- route_short_name
- merged_itineraries
- global_stop_id
'400':
description: Invalid global stop ID, missing required parameters, or no
result could be found
parameters: []
/v4/public/estimate_plan_duration:
get:
operationId: /v4/public/estimate_plan_duration
summary: /v4/public/estimate_plan_duration
description: "This endpoint returns an estimated duration for a trip plan based\
\ on the provided origin and destination. \n\nThe 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. "
parameters:
- in: query
schema:
type: number
name: from_lat
description: Latitude of the starting location for the trip. Required unless
from_global_stop_id is provided.
- in: query
schema:
type: number
name: from_lon
description: Longitude of the starting location for the trip. Required unless
from_global_stop_id is provided.
- in: query
schema:
type: string
name: from_global_stop_id
description: Global stop ID for the starting location. Alternative to from_lat/from_lon
parameters.
- in: query
schema:
type: number
name: to_lat
description: Latitude of the destination location for the trip. Required unless
to_global_stop_id is provided.
- in: query
schema:
type: number
name: to_lon
description: Longitude of the destination location for the trip. Required
unless to_global_stop_id is provided.
- in: query
schema:
type: string
name: to_global_stop_id
description: Global stop ID for the destination location. Alternative to to_lat/to_lon
parameters.
- in: query
name: mode
description: The primary mode of transportation for the trip
schema:
default: transit
type: string
enum:
- transit
- microtransit
- in: query
name: secondary_mode
description: The secondary mode of transportation for the trip, if applicable
schema:
type: string
enum:
- microtransit
- in: query
name: leave_time
description: UNIX timestamp representing the desired departure time for the
trip
schema:
type: number
- in: query
name: arrival_time
description: UNIX timestamp representing the desired arrival time for the
trip
schema:
type: number
- in: query
name: accessibility_need
description: "This parameter specifies accessibility requirements for the\
\ trip. The following values are available:\n - `none`: No specific accessibility\
\ needs are required; any valid trip may be returned.\n - `strict`: Returns\
\ only strictly accessible trips. Specifically, this includes only trips\
\ using accessible stops and accessible routes/vehicles.\n - `prioritize_step_free`:\
\ Prioritizes strictly accessible results but also includes less accessible\
\ alternatives (those with unknown or non-step-free accessibility).\n"
schema:
type: string
enum:
- none
- strict
- prioritize_step_free
default: none
- in: query
name: walk_reluctance
description: '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. '
schema:
type: number
- in: query
name: max_distance_between_location_and_stop
description: 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.
schema:
type: number
responses:
'200':
description: This endpoint provides an estimated trip duration in seconds
content:
application/json:
schema:
type: object
properties:
duration:
type: number
description: Estimated duration of the trip in seconds
type:
type: string
description: Type of trip plan (Transit, Walk, Bike, Car_Microtransit)
/v4/public/plan:
get:
operationId: /v4/public/plan
summary: /v4/public/plan
description: "This endpoint returns a plan from the origin to the destination\
\ in different modes, including multimodal trips. \n\nThis endpoint will eventually\
\ replace the /otp/plan. The OTP endpoint is deprecated as the OpenTripPlanner\
\ endpoint it's based on is also [deprecated](https://docs.opentripplanner.org/en/latest/Changelog/#250-2024-03-13). "
parameters:
- in: query
schema:
type: number
format: double
name: from_lat
description: Latitude of the starting location for the trip. Required unless
from_global_stop_id or from_global_stop_ids is provided.
- in: query
schema:
type: number
format: double
name: from_lon
description: Longitude of the starting location for the trip. Required unless
from_global_stop_id or from_global_stop_ids is provided.
- in: query
schema:
type: string
name: from_global_stop_id
description: Single global stop ID for the starting location. Kept for backward
compatibility; prefer from_global_stop_ids (plural) to describe a correspondence
zone. When from_lat/from_lon are also provided, the stop ID is ignored if
the stop is more than 150m away from them (see from_global_stop_ids).
- in: query
schema:
type: string
name: from_global_stop_ids
description: 'Comma-separated list of global stop IDs describing the origin
correspondence zone (e.g. all platforms of a hub across different networks/parent
stations). Each entry may be a platform stop id or a station stop id; stations
are automatically expanded to their child platform stops when deciding whether
to strip the initial walk leg.
Routing origin: if from_lat and from_lon are provided, the coordinates are
used to plan the trip. Otherwise the first valid stop''s location from the
list is used as a fallback.
Validation: unknown stop IDs are ignored. When from_lat and from_lon are
provided, any stop ID further than 1000m from them (150m when a single ID
is given) is ignored too, measured to the closest platform or entrance for
stations. Ignored IDs never strip a walk leg; if every ID is ignored, the
request behaves as if no stop ID was provided.
Walk-leg filtering: the initial walk leg is removed from a plan only when
the itinerary actually boards at one of the provided stops (or at their
parent station). Plans that board at an unrelated nearby stop keep their
walk leg so the client can still present directions to the stop.'
- in: query
schema:
type: number
format: double
name: to_lat
description: Latitude of the destination location for the trip. Required unless
to_global_stop_id or to_global_stop_ids is provided.
- in: query
schema:
type: number
format: double
name: to_lon
description: Longitude of the destination location for the trip. Required
unless to_global_stop_id or to_global_stop_ids is provided.
- in: query
schema:
type: string
name: to_global_stop_id
description: Single global stop ID for the destination location. Kept for
backward compatibility; prefer to_global_stop_ids (plural) to describe a
correspondence zone. When to_lat/to_lon are also provided, the stop ID is
ignored if the stop is more than 150m away from them (see to_global_stop_ids).
- in: query
schema:
type: string
name: to_global_stop_ids
description: 'Comma-separated list of global stop IDs describing the destination
correspondence zone. Behaves symmetrically to from_global_stop_ids: coordinates
win for routing when provided, otherwise the first valid stop''s location
is used; unknown IDs and IDs too far from to_lat/to_lon are ignored; the
final walk leg is stripped only when the itinerary actually alights at one
of the remaining stops.'
- in: query
name: mode
description: The primary mode of transportation for the trip
schema:
default: transit
type: string
enum:
- transit
- microtransit
- personal_bike
- walk
- shared_mobility
- in: query
name: secondary_mode
description: '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).'
schema:
type: string
enum:
- microtransit
- personal_bike
- walk
- shared_mobility
- in: query
name: secondary_mode_legs
description: 'Which ends of the trip may use `secondary_mode`. Only considered
when `mode` is `transit` and `secondary_mode` is `personal_bike`; ignored
otherwise.
- `first_and_last_legs` (default): the bike is used at both ends, so it
must ride along on every transit leg. Networks whose trips do not allow
bikes on board are excluded, which can leave no result at all.
- `first_leg`: bike from the origin to a stop and leave it there; the rest
of the trip is transit and walking.
- `last_leg`: walk and transit first, then bike from a stop to the destination.
The router only searches the requested combination, so a `first_leg` request
never returns bike+transit+bike plans and vice versa. Send two requests
to compare them.'
schema:
type: string
default: first_and_last_legs
enum:
- first_and_last_legs
- first_leg
- last_leg
- in: query
name: sharing_system_type
description: '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.'
schema:
type: string
enum:
- docked_bikeshare
- dockless_bikeshare
- scooters
default: docked_bikeshare
- in: query
name: leave_time
description: '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. '
schema:
type: number
- in: query
name: arrival_time
description: 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.
schema:
type: number
- in: query
name: accessibility_need
description: "This parameter specifies accessibility requirements for the\
\ trip. The following values ar
# --- truncated at 32 KB (203 KB total) ---
# Full source: https://artifacts.apis.io/transit/openapi/transit-v4-api-openapi.yml