Skip to main content
Menu MBTA Home Page
Home Developers V3 API

V3 API

The V3 API presents General Transit Feed Specification (GTFS), GTFS Realtime, and MBTA-specific data. It uses the JSON:API format, so you can get started using any of the available libraries.

V3 API Documentation

Read the latest endpoint and resource documentation about available fields, filters, and includes.

Read the documentation

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 following V3 API calls are available. To read endpoint documentation for a call, click its link:

CallDescription
Call/alerts DescriptionCommunications to riders about disrupted MBTA operations
Call/facilities DescriptionAmenities at stops, such as elevators, escalators, parking lots, and bike racks
Call/lines DescriptionLines for all modes (for example, line-Green)
Call/predictions DescriptionPredicted arrival/departure times
Call/routes DescriptionRoutes for each line (for example, Green-B)
Call/route_patterns DescriptionPossible patterns of travel for each route
Call/schedules DescriptionScheduled arrival/departure times (stop_time)
Call/services DescriptionDates when trips occur
Call/shapes DescriptionPolylines that describe trip shapes, which can be shown on a map
Call/stops DescriptionPlaces where riders board a vehicle, disembark from a vehicle, or navigate a station
Call/trips DescriptionMovement of vehicles from one route end to the other
Call/vehicles DescriptionVehicle positions, including direction, latitude, and longitude

Each call returns the object described. Following the JSON:API standard, you can filter and sort the list in various ways, and you can 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/routes DescriptionRetrieves 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/Orange DescriptionRetrieves 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 real-time 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.

Real-Time Display Guidelines

Real-Time Display Guidelines

The Walnut Avenue bus shelter on Columbus Avenue has a large digital screen that shows the time, the stop name, and the predicted arrival times for the next six buses scheduled to arrive there. The screen also mentions 50%-off Youth Pass fares, and asks riders to tell us how we can improve this screen by going to this web address: mbta.com/walnut-2
To consistently display GTFS Realtime and V3 API real-time service information to riders, we recommend following these guidelines.

Learn more

Developers

Developers

Woman working at her computer
The MBTA provides resources to help you work with current and historical data about our service.

Learn more


Use of MBTA data is governed by the MassDOT Developers License Agreement (PDF, 85.5 KB).

V3 API Documentation

Read the latest endpoint and resource documentation about available fields, filters, and includes.

Read the documentation

Real-Time Display Guidelines

Real-Time Display Guidelines

The Walnut Avenue bus shelter on Columbus Avenue has a large digital screen that shows the time, the stop name, and the predicted arrival times for the next six buses scheduled to arrive there. The screen also mentions 50%-off Youth Pass fares, and asks riders to tell us how we can improve this screen by going to this web address: mbta.com/walnut-2
To consistently display GTFS Realtime and V3 API real-time service information to riders, we recommend following these guidelines.

Learn more

Developers

Developers

Woman working at her computer
The MBTA provides resources to help you work with current and historical data about our service.

Learn more

Call Us

Information & Support

Monday thru Friday: 6:30 AM - 8 PM
Main: 617-222-3200
711 for TTY callers; VRS for ASL callers

Emergency Contacts

24 hours, 7 days a week
Transit Police: 617-222-1212
TTY: 711

Report a Railroad Crossing Gate Issue

To report a problem or emergency with a railroad crossing, call 800-522-8236
[フレーム]

AltStyle によって変換されたページ (->オリジナル) /