# MBTA

> Boston's public transit from the MBTA: realtime predictions for the next train or bus at a stop, timetables, service alerts, live vehicle positions, and the routes and stops of the subway, Green Line, buses, commuter rail and ferries. No account or API key required.

App · 7 actions. Web page: https://docs.lodol.com/docs/integrations/mbta

## Actions

### Get predictions

Get realtime predictions for the next trains, buses or boats at a stop, soonest first: route, destination, predicted arrival and departure, minutes away and any cancellation. No API key required.

**Inputs**

- Stop (`stop`, text, required): The stop or station id, e.g. 'place-pktrm' for all of Park Street. Find ids with List stops.
- Route (`route`, text): Only include this route id. Leave empty for all.
- Direction (`direction_id`, number): Only include trips going one way. Each route names its two directions (see List routes). Leave empty for both. One of: `0` (Direction 0 (e.g. southbound on the Red Line)), `1` (Direction 1 (e.g. northbound on the Red Line)).
- Number of results (`limit`, number): How many predictions to return, 1 to 100. Defaults to 10. From 1 to 100.

**Outputs**

- `count` (number): How many predictions, soonest first came back.
- `predictions` (list): The predictions, soonest first.
- `stop` (text): The stop id (or ids) the predictions are for.

**Example output**

```json
{
  "count": 1,
  "predictions": [
    {
      "arrival_time": "2026-10-16T14:34:58-04:00",
      "departure_time": "2026-10-16T14:36:33-04:00",
      "direction": "South",
      "direction_id": 0,
      "headsign": "Braintree",
      "is_cancelled": false,
      "minutes_away": 1,
      "platform_name": "Ashmont/Braintree",
      "route_id": "Red",
      "route_name": "Red Line",
      "schedule_relationship": null,
      "status": null,
      "stop_id": "70075",
      "stop_name": "Park Street",
      "trip_id": "77886131",
      "vehicle_id": "R-548C2A62"
    }
  ],
  "stop": "place-pktrm"
}
```

### List alerts

List MBTA service alerts (delays, shuttles, station closures, elevator outages and notices), most severe first, optionally for one route, stop or kind of service, and only those in effect now. No API key required.

**Inputs**

- Route (`route`, text): Only include alerts for this route id.
- Stop (`stop`, text): Only include alerts for this stop or station id.
- Kind of service (`route_type`, text): Only include this kind of service. Leave empty for all of them. One of: `light_rail` (Light rail (Green Line, Mattapan trolley)), `subway` (Subway (Red, Orange and Blue Lines)), `commuter_rail` (Commuter rail), `bus` (Bus (including Silver Line)), `ferry`.
- In effect now only (`active_now`, true/false): Only include alerts in effect right now, leaving out upcoming ones. Default: `false`.
- Number of results (`limit`, number): How many alerts to return, 1 to 200. Defaults to 20. From 1 to 200.

**Outputs**

- `alerts` (list): The alerts, most severe first.
- `count` (number): How many alerts, most severe first came back.

**Example output**

```json
{
  "alerts": [
    {
      "active_periods": [
        {
          "end": null,
          "start": "2026-10-07T15:03:54-04:00"
        }
      ],
      "affected_route_ids": [
        "Red"
      ],
      "affected_stop_ids": [
        "70105",
        "place-brntn"
      ],
      "cause": "Unknown cause",
      "created_at": "2026-10-07T15:03:54-04:00",
      "description": "Affected stations:\r\nBraintree",
      "effect": "Notice",
      "header": "Braintree Station notice: Premium parking is available at this location. You can buy premium passes and permits using SpotHero.",
      "id": "1037418",
      "lifecycle": "Ongoing",
      "service_effect": "Red Line notice",
      "severity": 1,
      "short_header": null,
      "timeframe": "ongoing",
      "updated_at": "2026-10-07T15:03:54-04:00",
      "url": "http://www.mbta.com/SpotHeroBraintree"
    }
  ],
  "count": 1
}
```

### List route patterns

List the different ways an MBTA route's trips run (each branch, short turn and diversion) with where they go and how typical each is. No API key required.

**Inputs**

- Route (`route`, text, required): The route id, e.g. 'Red' or '1'.
- Direction (`direction_id`, number): Only include trips going one way. Each route names its two directions (see List routes). Leave empty for both. One of: `0` (Direction 0 (e.g. southbound on the Red Line)), `1` (Direction 1 (e.g. northbound on the Red Line)).

**Outputs**

- `count` (number): How many route patterns, typical ones first came back.
- `route_patterns` (list): The route patterns, typical ones first.

**Example output**

```json
{
  "count": 1,
  "route_patterns": [
    {
      "direction": "South",
      "direction_id": 0,
      "headsign": "Braintree",
      "id": "Red-3-0",
      "is_canonical": true,
      "name": "Alewife - Braintree",
      "route_id": "Red",
      "time_description": null,
      "typicality": 1,
      "typicality_label": "Typical"
    }
  ]
}
```

### List routes

List the MBTA's routes (subway lines, Green Line branches, buses, commuter rail lines and ferries) with their colors and the names and destinations of their two directions. Filter by kind of service or by a stop to see what serves it. No API key required.

**Inputs**

- Kind of service (`route_type`, text): Only include this kind of service. Leave empty for all of them. One of: `light_rail` (Light rail (Green Line, Mattapan trolley)), `subway` (Subway (Red, Orange and Blue Lines)), `commuter_rail` (Commuter rail), `bus` (Bus (including Silver Line)), `ferry`.
- Stop (`stop`, text): Only include routes that serve this stop or station id. Leave empty for all routes.
- Number of results (`limit`, number): How many routes to return, 1 to 200. Defaults to 20. From 1 to 200.

**Outputs**

- `count` (number): How many routes, in the MBTA's own order came back.
- `routes` (list): The routes, in the MBTA's own order.

**Example output**

```json
{
  "count": 1,
  "routes": [
    {
      "color": "#DA291C",
      "description": "Rapid Transit",
      "directions": [
        {
          "destination": "Ashmont/Braintree",
          "direction_id": 0,
          "name": "South"
        },
        {
          "destination": "Alewife",
          "direction_id": 1,
          "name": "North"
        }
      ],
      "fare_class": "Rapid Transit",
      "id": "Red",
      "long_name": "Red Line",
      "name": "Red Line",
      "route_type": "Subway",
      "short_name": null,
      "text_color": "#FFFFFF",
      "url": "https://www.mbta.com/schedules/Red"
    }
  ]
}
```

### List schedules

List scheduled arrival and departure times at a stop or along a route for a day, optionally between two times of day, earliest first. No API key required.

**Inputs**

- Stop (`stop`, text): The stop or station id. Give a stop, a route, or both.
- Route (`route`, text): Only include this route id.
- Direction (`direction_id`, number): Only include trips going one way. Each route names its two directions (see List routes). Leave empty for both. One of: `0` (Direction 0 (e.g. southbound on the Red Line)), `1` (Direction 1 (e.g. northbound on the Red Line)).
- Date (`service_date`, date): The day to list, within the current timetable. Defaults to today.
- From time (`min_time`, text): Only include times from this time of day, e.g. 07:30 (Boston time).
- Until time (`max_time`, text): Only include times up to this time of day, e.g. 09:00.
- Number of results (`limit`, number): How many times to return, 1 to 200. Defaults to 20. From 1 to 200.

**Outputs**

- `count` (number): How many scheduled times, earliest first came back.
- `schedules` (list): The scheduled times, earliest first.

**Example output**

```json
{
  "count": 1,
  "schedules": [
    {
      "arrival_time": "2026-10-16T18:03:00-04:00",
      "departure_time": "2026-10-16T18:03:00-04:00",
      "direction": "South",
      "direction_id": 0,
      "drop_off": "Regular",
      "headsign": "Braintree",
      "is_timepoint": false,
      "pickup": "Regular",
      "platform_name": "Ashmont/Braintree",
      "route_id": "Red",
      "route_name": "Red Line",
      "stop_id": "70075",
      "stop_name": "Park Street",
      "stop_sequence": 70,
      "trip_id": "77886154"
    }
  ]
}
```

### List stops

List the stations along an MBTA route, or the stations and stops near a point (nearest first), with their ids, addresses, coordinates and wheelchair access. Use a stop id from here in Get predictions or List schedules. No API key required.

**Inputs**

- Route (`route`, text): List the stations on this route id. Give this, or a latitude and longitude, or both.
- Latitude (`latitude`, number): Find stops near this latitude (with longitude). From -90 to 90.
- Longitude (`longitude`, number): Find stops near this longitude (with latitude). From -180 to 180.
- Within (miles) (`radius_miles`, number): How far from the point to look, in miles. Defaults to 0.5. From 0.01 to 10.0.
- Number of results (`limit`, number): How many stops to return, 1 to 200. Defaults to 20. From 1 to 200.

**Outputs**

- `count` (number): How many stations and stops came back.
- `stops` (list): The stations and stops.

**Example output**

```json
{
  "count": 1,
  "stops": [
    {
      "address": "Alewife Brook Pkwy and Cambridge Park Dr, Cambridge, MA 02140",
      "description": null,
      "id": "place-alfcl",
      "kind": "station",
      "latitude": 42.39583,
      "longitude": -71.141287,
      "municipality": "Cambridge",
      "name": "Alewife",
      "parent_station_id": null,
      "platform_name": null,
      "url": "https://www.mbta.com/stops/place-alfcl",
      "vehicle_type": null,
      "wheelchair_accessible": true
    }
  ]
}
```

### List vehicles

See where every vehicle on an MBTA route is right now: its position, the stop it is at or heading to, its destination and how full it is. No API key required.

**Inputs**

- Route (`route`, text, required): The route id, e.g. 'Red' or '1'.
- Direction (`direction_id`, number): Only include trips going one way. Each route names its two directions (see List routes). Leave empty for both. One of: `0` (Direction 0 (e.g. southbound on the Red Line)), `1` (Direction 1 (e.g. northbound on the Red Line)).
- Number of results (`limit`, number): How many vehicles to return, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many vehicles came back.
- `vehicles` (list): The vehicles.

**Example output**

```json
{
  "count": 1,
  "vehicles": [
    {
      "bearing": 350.0,
      "carriage_count": 6,
      "current_status": "Incoming at",
      "direction": "North",
      "direction_id": 1,
      "headsign": "Alewife",
      "id": "R-548C3BF7",
      "in_revenue_service": true,
      "label": "1825",
      "latitude": 42.37293,
      "longitude": -71.11652,
      "occupancy": null,
      "platform_name": "Alewife",
      "route_id": "Red",
      "route_name": "Red Line",
      "speed_mps": null,
      "stop_id": "70068",
      "stop_name": "Harvard",
      "trip_id": "NONREV-1580831388",
      "updated_at": "2026-10-16T14:34:37-04:00"
    }
  ]
}
```
