mbta.com APImbta.com ↗
Access real-time MBTA subway, bus, and commuter rail departures, service alerts, stop details, and route schedules for Greater Boston via a simple REST API.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/d20edddc-f498-4ec2-afaf-f3b075eef2af/get_subway_lines' \ -H 'X-API-Key: $PARSE_API_KEY'
Get a list of all MBTA subway lines including their IDs, names, and schedule URLs.
No input parameters required.
{
"type": "object",
"fields": {
"lines": "array of subway line objects, each with id, name, and url"
},
"sample": {
"data": {
"lines": [
{
"id": "Red",
"url": "https://www.mbta.com/schedules/Red",
"name": "Red Line"
},
{
"id": "Orange",
"url": "https://www.mbta.com/schedules/Orange",
"name": "Orange Line"
}
]
},
"status": "success"
}
}About the mbta.com API
This API exposes 7 endpoints covering the full MBTA network — subway, bus, and commuter rail — across Greater Boston. Use get_stop_departures to retrieve real-time and scheduled departure predictions for any stop, including arrival and departure times, trip headsigns, and route identifiers. Companion endpoints return route lists, stop-level accessibility data, parking, fare facilities, and active service alerts.
Route and Stop Discovery
Three list endpoints cover the MBTA's main service types: get_subway_lines returns all subway lines with their IDs and schedule URLs, get_bus_routes covers Silver Line, crosstown, and local bus routes, and get_commuter_rail_lines returns all commuter rail lines (e.g. CR-Fitchburg). Each object in those arrays includes an id suitable for passing directly to get_route_details or get_route_alerts.
Route Details and Stop Topology
get_route_details accepts a route_id (e.g. Red, 1, CR-Fitchburg) and an optional direction_id (0 or 1). The response includes a stop_tree with a starting_nodes array and a by_id map — each stop entry carries station features, accessibility information, parking details, and connections to other lines. route_stop_lists provides an ordered stop sequence for the route, and other_route_stops lists stops at shared stations served by additional routes.
Real-Time Departures and Stop Info
get_stop_departures takes a stop_id (e.g. place-sstat for South Station, place-harsq for Harvard Square) and returns an array of departure objects. Each includes arrival_time, departure_time, a trip object with headsign, direction_id, and id, plus the route.id and platform_stop_id. get_stop_info returns static station data for the same stop IDs: name, address, municipality, lat/lon, accessibility features, parking lots, fare facilities, bike storage, and child stop IDs.
Service Alerts
get_route_alerts accepts a comma-separated list of route IDs (e.g. Red,Orange) and returns current alerts. Each alert object includes header, description, effect, cause, severity, priority, active_period, informed_entity, and lifecycle. This makes it straightforward to surface disruptions alongside departure data in any transit-facing application.
- Display real-time next-departure boards for any MBTA subway or bus stop using
get_stop_departures - Build a commute planner that cross-references departure times with active service alerts from
get_route_alerts - Show accessible station details — elevator availability, parking, fare facilities — from
get_stop_info - Map all stops along a subway or commuter rail line using the ordered stop lists from
get_route_details - Identify transfer points between lines using the
connectionsdata in thestop_treeresponse - Power a service-disruption notification system by polling
get_route_alertsfor severity and active_period changes - Enumerate all MBTA bus routes and their schedule URLs for a static transit reference tool
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the MBTA have an official developer API?+
What does `get_stop_departures` return, and how is it different from a static schedule?+
get_stop_departures returns both real-time predictions and scheduled departures for a given stop. Each departure object includes arrival_time, departure_time, the trip's headsign and direction_id, and the route.id. When live vehicle data is available, the times reflect current predictions rather than the fixed timetable.Does `get_route_details` cover ferry or other non-rail/bus services?+
Can I retrieve trip or vehicle position data — for example, a bus's current GPS location?+
Are service alerts returned for all route types, or only certain ones?+
get_route_alerts works with any route ID from the subway, bus, or commuter rail lists — pass a single ID or a comma-separated set like Red,Orange. The response fields include effect, cause, severity, priority, and active_period, so you can filter by urgency or time window in your own application logic.