Discover/mbta.com API
live

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.

Endpoints
7
Updated
3mo ago
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.
Use it in your codegrab 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'
All endpoints · 7 totalclick to expand

Get a list of all MBTA subway lines including their IDs, names, and schedule URLs.

Input

No input parameters required.

Response
{
  "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.

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,000250 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 →
idealista.pt API
Search and filter property listings across Portugal by location, price, and size, then access detailed information about each property including its characteristics and pricing history. Monitor how property prices change over time to help you make informed decisions about buying or selling real estate.
homedepot.com API
Search and browse Home Depot's product catalog to compare pricing, check real-time availability, and review detailed product specifications. Find products across all categories, look up store locations and hours, and check fulfillment options including in-store pickup and delivery.
zocdoc.com API
Search for doctors and medical practices on Zocdoc by specialty and location. Retrieve provider profiles, accepted insurance, office locations, patient reviews, and appointment availability.
opentable.com API
Search for restaurants across the US with ratings, reviews, photos, and pricing information, plus get real-time availability and autocomplete suggestions as you type. Check reservation openings and explore detailed restaurant features to find and book your perfect dining experience.
zapimoveis.com.br API
Search and filter real estate listings across Brazil on ZAP Imóveis — the country's largest property portal. Retrieve listings for sale or rent with detailed attributes including price, location, size, bedrooms, bathrooms, parking, and amenities. Supports location autocomplete, property type discovery, and full listing detail retrieval.
immobiliare.it API
Search Italian property listings for sale or rent, browse real estate agencies, and explore price trends across Italian cities — all via immobiliare.it.
angieslist.com API
Search for home service professionals on Angi and access their detailed profiles including reviews, contact information, and photos to find the right contractor for your project. Quickly compare multiple service providers by viewing their ratings, customer feedback, and verified business details all in one place.
api.nasa.gov API
Access NASA's suite of open data APIs — including the Astronomy Picture of the Day, Near Earth Object tracking, DONKI space weather events, EPIC Earth imagery, Mars weather, the NASA Image and Video Library, the Exoplanet Archive, and EONET natural events.