Discover/MBTA API
live

MBTA 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.

Endpoint health
verified 7d ago
get_route_details
get_subway_lines
get_bus_routes
get_commuter_rail_lines
get_stop_departures
7/7 passing latest checkself-healing
Endpoints
7
Updated
22d ago

What is the MBTA 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.

Try it

No input parameters required.

api.parse.bot/scraper/d20edddc-f498-4ec2-afaf-f3b075eef2af/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/d20edddc-f498-4ec2-afaf-f3b075eef2af/get_subway_lines' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace mbta-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

from parse_apis.mbta_transit_api import MBTA, SubwayLine, Route, Stop, StopInfo, Departure, Alert, Direction

mbta = MBTA()

# List all subway lines
for line in mbta.subwaylines.list():
    print(line.id, line.name, line.url)

# Get route details for the Red Line southbound
red = mbta.route(id="Red")
detail = red.details(direction_id=Direction.SOUTHBOUND)
print(detail.stop_tree.starting_nodes, detail.stop_tree.edges)

# Get station info for South Station
station = mbta.stop(id="place-sstat").info()
print(station.name, station.municipality, station.latitude, station.longitude)

# List departures from South Station
for departure in mbta.stop(id="place-sstat").departures.list():
    print(departure.departure_time, departure.platform_stop_id, departure.schedule_id)

# List alerts for Red Line
for alert in mbta.route(id="Red").alerts.list():
    print(alert.id, alert.header, alert.severity, alert.effect)
All endpoints · 7 totalmissing one? ·

Retrieve all MBTA subway lines. Returns each line's ID, display name, and schedule URL. The subway network includes Red, Orange, Blue, Green, and Mattapan lines.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "lines": "array of subway line objects with id, name, and url"
  },
  "sample": {
    "data": {
      "lines": [
        {
          "id": "Red",
          "url": "https://www.mbta.com/schedules/Red",
          "name": "Red Line"
        },
        {
          "id": "Mattapan",
          "url": "https://www.mbta.com/schedules/Mattapan",
          "name": "Mattapan Line"
        },
        {
          "id": "Orange",
          "url": "https://www.mbta.com/schedules/Orange",
          "name": "Orange Line"
        },
        {
          "id": "Blue",
          "url": "https://www.mbta.com/schedules/Blue",
          "name": "Blue Line"
        },
        {
          "id": "Green",
          "url": "https://www.mbta.com/schedules/Green",
          "name": "Green Line"
        }
      ]
    },
    "status": "success"
  }
}

About the MBTA API

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.

Reliability & maintenanceVerified

The MBTA API is a managed, monitored endpoint for mbta.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when mbta.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official mbta.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
7d ago
Latest check
7/7 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • 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 connections data in the stop_tree response
  • Power a service-disruption notification system by polling get_route_alerts for severity and active_period changes
  • Enumerate all MBTA bus routes and their schedule URLs for a static transit reference tool
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does the MBTA have an official developer API?+
Yes. The MBTA publishes its V3 API at https://api-v3.mbta.com, with documentation at https://www.mbta.com/developers/v3-api. It requires a free API key for production use.
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?+
The three route-list endpoints cover subway, bus, and commuter rail. Ferry routes are not currently exposed. You can fork this API on Parse and revise it to add a ferry-routes endpoint using the relevant route IDs.
Can I retrieve trip or vehicle position data — for example, a bus's current GPS location?+
Vehicle position data is not currently returned by any endpoint. The API covers departure predictions, stop details, route topology, and service alerts. You can fork this API on Parse and revise it to add a vehicle-positions endpoint that returns live location data.
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.
Page content last updated . Spec covers 7 endpoints from mbta.com.
Related APIs in Maps GeoSee all →
bart.gov API
Track live BART train departures and arrival estimates across all Bay Area stations in real-time. Find your nearest station and see exactly when the next train is arriving on every platform.
citymapper.com API
Get real-time transit information including live stop arrivals, service status, and line details across major cities worldwide. Search for nearby transit options and stay informed with service alerts to plan your commute efficiently.
ratp.fr API
Monitor real-time traffic conditions and service disruptions across Paris's RATP and RER networks to plan your commute efficiently. Get instant updates on line statuses, delays, and service alerts for all metro and regional rail lines.
nationalrail.co.uk API
Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.
gtt.to.it API
Access GTT (Turin) public transport data including available service basins, line routes and stop lists, full-day timetables by route and date, stop search, and real-time arrivals with accessibility details.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.
mavplusz.hu API
Get real-time and scheduled departure information for Hungarian public transit stops, including destinations, line numbers, platforms, and route details from the MÁV+ system. Plan your journey across Hungary with up-to-date transit data at your fingertips.
metro.istanbul API
Plan your Istanbul Metro trips by checking real-time service status, finding stations on specific lines, and looking up current ticket prices. Access detailed information about all metro lines and the complete network map to navigate the city's transit system efficiently.