Reference · built on requestCommons signalTransit, roads & mobility

MBTA V3 API

JSON:API predictions, vehicle positions, alerts, and schedules for the MBTA, with server-sent event streaming for keyed apps.

About

The Massachusetts Bay Transportation Authority serves the V3 API from api-v3.mbta.com as JSON:API over its GTFS and GTFS-realtime data, with the source code on GitHub. Twelve resources cover alerts, facilities, lines, predictions, routes, route_patterns, schedules, services, shapes, stops, trips, and vehicles. Anonymous calls are tracked by IP address and held to 20 requests a minute; a free key raises that to 1,000. Index endpoints also stream over server-sent events, so a keyed client can hold one connection instead of polling.

Through Fibric, an operator subscribes to the stops and routes that matter to your sites and proposes a staffing or notice change with the prediction or alert attached.

This is a reference listing. It documents what Fibric would read from MBTA V3 API and what it could propose, based on the publisher's published interfaces. Fibric builds it under a managed deployment when you request it; selecting it here installs nothing.

Inputs

  • Predictions for a stop, route, trip, or radius through /predictions with filter[stop], filter[route], filter[trip], filter[latitude], filter[longitude], and filter[radius]
  • Vehicle positions with direction and coordinates through /vehicles, filtered by id, trip, label, route, direction_id, route_type, or revenue
  • Alerts through /alerts with filter[activity], filter[lifecycle], filter[severity], filter[datetime], filter[stop], and filter[route]
  • Timetabled stop times through /schedules, trips from first stop to last through /trips, and operating dates through /services
  • Stop amenities such as elevators, escalators, parking, and bike racks through /facilities
  • Streaming reset, add, update, and remove events on any index endpoint with Accept: text/event-stream
  • GTFS-realtime Alerts, TripUpdates, and VehiclePositions from cdn.mbta.com as .pb, .json, and _enhanced.json, and the static MBTA_GTFS.zip

Proposed actions

Read-only. This feed informs operators; it changes nothing.

Proposed actions are target capabilities. Every action runs propose-first and needs a validated deployment and the appropriate permissions.

What you can build

  • Stream alerts for the lines your staff ride

    One keyed connection to /alerts with filter[route] delivers add, update, and remove events. When an alert names a line before a shift, Shift Coverage proposes who covers the gap and attaches the alert.

    With Shift Coverage

  • Time surge staffing to trains that are actually arriving

    Predictions for the stop beside the venue, refreshed about every twelve seconds, show when the crowd lands. The operator proposes when each extra person starts and leaves a record of the prediction it used.

    With Event Surge

  • Match a late arrival to a late vehicle

    A missed start is checked against /vehicles and /predictions for that route at that time. If the vehicle ran behind, the operator proposes an excused mark with the MBTA record attached.

    With No-Show Response

Requirements

  • A developer account and one key per app; the MBTA says a key can take a day to arrive
  • The stop, route, and trip ids your sites care about, taken from /stops and /routes
  • Acceptance of the MassDOT Developers License Agreement, which asks you to acknowledge MassDOT as the data provider
  • A client that honours x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset
Authentication
A free API key from api-v3.mbta.com/register, sent as the x-api-key header or the api_key query parameter; anonymous calls work at a lower limit, and streaming needs a key.

Limits

  • 20 requests a minute without a key and 1,000 a minute by default with one; higher limits are by request
  • Conditional requests with If-Modified-Since return 304 without counting against the limit, but only for the root data type, not included resources
  • In a stream, only the primary resource is tracked for updates; included resources are not
  • The licence is revocable, the data come as is, and MassDOT may change or withdraw feeds without notice

Access and pricing

Reference listing. Public feed access is separate from Fibric integration. If you request this feed, your quote covers the build, usage, and support.

Request MBTA V3 API ↗

Questions and answers

Do I need an API key for the MBTA V3 API?
Not to experiment. Anonymous requests are tracked by IP address and limited to 20 a minute. A free key from api-v3.mbta.com raises the default to 1,000 a minute and is required for streaming. Rate-limit headers on every response show your remaining budget.
How fresh are predictions and vehicle positions?
The MBTA's best-practices page says predictions update about every twelve seconds and vehicle positions more than once a second. The static GTFS zip changes several times a month; the MBTA suggests checking its Last-Modified header daily.
How does streaming work?
Send Accept: text/event-stream with a key to an index endpoint such as /vehicles. The server first sends a reset event with the full state, then add, update, and remove events as JSON:API objects. Only the opening request counts against your rate limit.
Ask about MBTA V3 API

Ask about the capabilities and requirements in this listing.

For project-specific requirements, contact Fibric.