GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Menu
  • Subway
  • Bus
  • Commuter Rail
  • Ferry
  • Paratransit (The RIDE)
  • All Schedules & Maps
  • Trip Planner
  • Service Alerts
  • Sign Up for Service Alerts
  • Parking
  • Bikes
  • User Guides
  • Holidays

This view

  • Original page
  • New address

GeezerVison is showing www.mbta.com — V3 API | Developers | MBTA

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

Skip to any section below:

  • Request an API Key
  • Make Basic Calls
    • Filter Data
    • Include Relationships
  • Use Best Practices
  • Learn About API Updates

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/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/shapesDescriptionPolylines that describe trip shapes, which can be shown on a map
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, 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/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 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.

Use Best Practices

Best Practices

Learn helpful tips for using the V3 API.

Streaming

Learn how to stream updates on predictions, vehicle locations, and alerts.

Real-Time Display Guidelines

Real-Time Display Guidelines

Photo of the Walnut Avenue bus shelter, which has a large digital screen that shows countdowns and other information for riders.
To consistently show GTFS Realtime and V3 API real-time service information to riders, follow these guidelines.

Read guidelines

Learn About API Updates

Versioning

Learn about how we handle versioning.

Changelog

Keep track of backwards-incompatible API changes.

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

Photo of the Walnut Avenue bus shelter, which has a large digital screen that shows countdowns and other information for riders.
To consistently show GTFS Realtime and V3 API real-time service information to riders, follow these guidelines.

Read guidelines

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

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.