Skip to main content
Menu

V3 API

The V3 API provides access to MBTA schedules, alerts, and realtime information. It uses the JSON:API format, so you can get started using any of the available libraries.

MBTA V3 API Portal

Request a key, read endpoint and resource documentation, and explore the API.

Register for the developer portal

Request an API Key

We recommend using a V3 API key early in your development process. A valid key is required to make a default of 1,000 requests per minute, control the version, and stream requests.

Request a free key

Make Basic Calls

The V3 API data model is based on the General Transit Feed Specification (GTFS) and GTFS Realtime, where applicable. The following calls are available. To read endpoint documentation for a call, click its link:

CallDescription
Call/alertsDescriptionCommunications to riders about disrupted MBTA operations
Call/facilitiesDescriptionAmenities at stops, such as elevators, escalators, parking lots, and bike racks
Call/linesDescriptionLines for all modes (for example, line-Green)
Call/predictionsDescriptionPredicted arrival/departure times
Call/routesDescriptionRoutes for each line (for example, Green-B)
Call/route_patternsDescriptionPossible patterns of travel for each route
Call/schedulesDescriptionScheduled arrival/departure times (stop_time)
Call/servicesDescriptionDates when trips occur
Call/shapesDescriptionStops and maps for routes and their patterns
Call/stopsDescriptionPlaces where riders board a vehicle, disembark from a vehicle, or navigate a station
Call/tripsDescriptionMovement of vehicles from one route end to the other
Call/vehiclesDescriptionVehicle positions, including direction, latitude, and longitude

Each call returns the object described. Following the JSON:API standard, options are provided to filter and sort the list in various ways, and to include other objects with related information.

Filter Data

The following examples of filtering use the /routes call. To test a call, click its link:

CallDescription
Call/routesDescriptionRetrieves a list, in the data[] object, of all routes
Call/routes
?filter[type]=0,1
DescriptionRetrieves only the routes with a route type of 0 or 1 (subway)
Call/routes
?filter[stop]=place-north
DescriptionRetrieves only the routes that have trips stopping at the stop, place-north (North Station)
Call/routes
?filter[type]=0,1
&filter[stop]=place-north
DescriptionCombines the filters above to retrieve only subway trips stopping at North Station
Call/routes/OrangeDescriptionRetrieves only the route with route_id Orange

Include Relationships

An arrival time doesn't mean much unless you know where the vehicle is arriving and where it's going next. Some objects are defined largely by their relationship to other objects. Those other objects can be included in the results, and you can nest included resources.

The following examples of including use the /schedules call with the same filters. To test a call, click its link:

CallDescription
Call/schedules
?filter[min_time]=14:00
&filter[max_time]=14:30
&filter[stop]=17094
DescriptionReturns a selection of scheduled stops (stop_times), which contains the route_id, trip_id, and stop_id, but no information about the corresponding trip, route, or stop
Call/schedules
?include=route
&filter...
DescriptionIncludes each route object referenced by a schedule object, returning the route name, mode, color, etc. The included values are in an include[] object and can be looked up from the schedule by their type and ID.
Call/schedules
?include=route,trip,stop
&filter...
DescriptionIncludes the routes as well as the trips and stops
Call/schedules
?include=prediction
&filter...
DescriptionIncludes realtime predictions (if any) currently being made for the returned scheduled times. In this example URL, you're only likely to see predictions if you make the call around 1:30 – 2:30 PM ET.

The following example returns predictions with useful information about their related stops. To test the call, click its link:

CallDescription
Call/predictions
?filter[stop]=place-sstat
&filter[direction_id]=0
&include=stop
DescriptionReturns predictions from South Station with direction_id 0. Each prediction has a relationship with a stop, which corresponds to the platform where the vehicle will be. The ID of the related stop can be cross-referenced with the included stops to get useful information, such as the platform_code from which the vehicle for the prediction will leave.

Learn More

Developers

Learn more

Use of MBTA data is governed by the MassDOT Developers License Agreement.

MBTA V3 API Portal

Request a key, read endpoint and resource documentation, and explore the API.

Register for the developer portal

Developers

Learn more