canonical: https://jentic.com/apis/mbta.com/mbta

# MBTA V3 API

Jentic publishes the only available OpenAPI specification for MBTA V3 API, keeping it validated and agent-ready. The MBTA V3 API exposes real-time and scheduled transit data for the Massachusetts Bay Transportation Authority covering subway, commuter rail, bus, and ferry services across Greater Boston. It follows the JSON:API specification and includes 24 endpoints for stops, routes, schedules, predictions, vehicles, alerts, facilities, and trip planning data. Agents use it for arrival predictions, service alerts, and accessibility-aware journey planning.

## For AI agents

Get real-time and scheduled MBTA transit data for Boston subway, bus, commuter rail, and ferry - including predictions, alerts, and vehicle positions.

## Scope

Does not handle fare payment, ticketing, or driving directions - use for MBTA transit data, predictions, alerts, and vehicle tracking only.

## Capabilities

- Retrieve real-time arrival predictions for any MBTA stop
- Pull current vehicle positions for buses, trains, and ferries
- List active service alerts affecting routes, stops, or trips
- Look up scheduled trips and stop-time tables for a route
- Surface elevator and escalator status from facility data
- Fetch route shapes and geometry for map rendering
- Resolve stop and station metadata including accessibility flags

## Use cases

### Real-Time Arrival Display

Show next-bus and next-train countdowns on a kiosk, signage screen, or chat interface using MBTA prediction data. The /predictions endpoint returns upcoming arrivals filtered by stop, route, or trip, with departure timestamps and direction. Agents typically poll every 15-30 seconds and render the soonest two or three arrivals per direction.

Example prompt: Call GET /predictions filtered by stop=place-pktrm and direction_id=0, then return the next three arrival times grouped by route.

### Service Alert Monitoring

Watch for new MBTA service alerts that affect a defined set of routes or stops and notify riders through Slack, email, or a status page. The /alerts endpoint returns currently active alerts with severity, lifecycle, affected services, and human-readable descriptions. Agents diff the response against the previous poll and post only newly-active or newly-cleared entries.

Example prompt: Call GET /alerts filtered by route=Red and lifecycle=NEW, then post any results to a Slack channel as a formatted message including the alert header and effect.

### Accessibility-Aware Trip Planning

Help riders with mobility needs avoid stations with broken elevators by combining /facilities and /live_facilities responses with /stops. Agents read the live facility status, filter stops where elevators are out of service, and recommend alternate stations or routes. This is increasingly important for MBTA's accessibility commitments and rider experience.

Example prompt: Call GET /live_facilities, filter to facilities with current_status=OUT_OF_ORDER and type=ELEVATOR, then return the affected stop ids.

### AI Agent for Daily Commuter Briefings

Build an agent that, each weekday morning, queries MBTA predictions and alerts for a commuter's stops and routes, then sends a tailored briefing to their phone. The agent searches Jentic for 'check MBTA service status', loads the alerts and predictions schemas, and executes calls scoped to the user's saved routes. The output is a one-paragraph briefing answering 'should I leave now?' without the user opening multiple transit apps.

Example prompt: For routes Red and 1 from stop place-cntsq, call GET /alerts and GET /predictions, then return a paragraph summarising any active alerts plus the next two arrival times for each route.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /predictions | Real-time arrival predictions |
| GET | /alerts | Active service alerts |
| GET | /routes | List MBTA routes |
| GET | /stops | List stops and stations |
| GET | /vehicles | Live vehicle positions |
| GET | /schedules | Scheduled trips and stop times |
| GET | /live_facilities | Current facility status |
| GET | /lines | Logical transit lines grouping routes |

## Key resources

- **Predictions** — Real-time arrival and departure predictions
- **Alerts** — Active service alerts and disruptions
- **Routes** — Subway, bus, commuter rail, and ferry routes
- **Stops** — Stops and stations with location and accessibility data
- **Vehicles** — Live vehicle positions and statuses
- **Schedules** — Scheduled trips and stop times
- **Facilities** — Station facilities including elevators and escalators
- **Live Facilities** — Current facility status and outages

## Why Jentic

- **Setup:** Wiring the MBTA V3 API by hand means sending your key in the x-api-key header, pointing at the api-v3.mbta.com host, and parsing its JSON:API responses yourself. Through Jentic you install once, import the MBTA V3 API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** MBTA queries filter transit data through query parameters rather than resource ids in the URL path, so you limit the agent to the operations it needs, such as fetching predictions, alerts, or vehicle positions. It calls only the operations you allow, and since this surface is read-only, it retrieves transit data without any write access.
- **Credential handling:** Your MBTA API key is stored once, encrypted, by your own Jentic One instance and attached to the x-api-key header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get MBTA arrival predictions for a stop', and Jentic returns the matching MBTA operation with its input schema so the agent calls the right endpoint without parsing the JSON:API documentation.

## Related APIs

- **Transit** — Multi-agency transit data including MBTA aggregated with hundreds of other systems
- **BART** — Bay Area Rapid Transit equivalent for the San Francisco region
- **TomTom Routing** — Driving and walking routing to bridge the first/last mile around MBTA stops

## FAQ

### Why is there no official OpenAPI spec for MBTA V3 API?

MBTA does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call MBTA V3 API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the MBTA V3 API use?

MBTA accepts an API key either as a query parameter (api_key) or in the x-api-key header. Anonymous calls work but with much stricter rate limits. Through Jentic, the key is stored encrypted in your Jentic One instance and injected as a header at execution time, so the raw key never enters the agent's transcript.

### Can I get real-time vehicle positions with the MBTA API?

Yes. GET /vehicles returns live vehicle positions, including latitude, longitude, current status, and bearing, filterable by route or trip. Combined with /predictions, this is the standard data source for arrival countdown displays and live route maps.

### What are the rate limits for the MBTA V3 API?

Anonymous usage is capped at around 20 requests per minute; authenticated keys are typically allowed 1,000 requests per minute. The exact limits and how to request a higher tier are documented at api-v3.mbta.com. Responses use 429 status codes when limits are exceeded.

### How do I get arrival predictions through Jentic?

Search Jentic for 'get MBTA arrival predictions for a stop', load the schema for GET /predictions, and execute with filter[stop]=place-pktrm. Jentic attaches the API-key header automatically and returns predictions sorted by arrival time.

### Does the MBTA API include accessibility data?

Yes. GET /facilities returns elevators, escalators, and parking facilities with type and properties, and GET /live_facilities returns current operational status. Together these let agents build accessibility-aware journey suggestions that route riders around out-of-order elevators.

### Does the MBTA API follow the JSON:API specification?

Yes. Responses follow the JSON:API spec with data, attributes, relationships, and included sections, and requests support sparse fieldsets, includes, and filters. This makes it well-suited to single-call composite responses, but agents need to parse the JSON:API envelope rather than expecting flat objects.

### Can I limit what my agent is allowed to do with the MBTA V3 API?

Yes. Because you run Jentic One yourself, your own rules decide which MBTA operations and credentials the agent can use, so you can allow just the calls it needs, such as GET /predictions, GET /alerts, or GET /vehicles, and withhold the rest. MBTA filters transit data through query parameters rather than resource ids in the URL path, so scoping happens at the operation level and the agent only ever calls the operations you permit. Since this surface is entirely read-only, the agent retrieves transit data with no write access at all.
