Skip to main content
GET
https://www.mtaapi.dev
/
api
/
v1
/
bus
/
routes
/
{route}
/
stops
Get ordered bus stops for a route
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://www.mtaapi.dev/api/v1/bus/routes/{route}/stops', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "route": {
    "id": "<string>",
    "shortName": "<string>",
    "longName": "<string>",
    "type": 123,
    "color": "<string>",
    "textColor": "<string>"
  },
  "directions": [
    {
      "direction": "<string>",
      "stops": [
        {
          "id": "<string>",
          "name": "<string>",
          "displayName": "<string>",
          "lat": 123,
          "lon": 123,
          "parentId": "<string>",
          "arrivals": [
            {
              "route": {
                "id": "<string>",
                "shortName": "<string>",
                "longName": "<string>",
                "type": 123,
                "color": "<string>",
                "textColor": "<string>"
              },
              "stop": {
                "id": "<string>",
                "name": "<string>",
                "displayName": "<string>",
                "lat": 123,
                "lon": 123,
                "parentId": "<string>"
              },
              "arrivalTime": "<string>",
              "minutes": 123,
              "realtime": true,
              "source": "<string>",
              "destination": "<string>",
              "displayDirection": "<string>",
              "headsign": "<string>",
              "departureTime": "<string>",
              "tripId": "<string>",
              "raw": "<unknown>"
            }
          ]
        }
      ],
      "headsigns": [
        "<string>"
      ]
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://mtaapi.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Returns the ordered stops a bus route serves. Pass the route in the path (for example M23) and an optional direction filter. Set includeArrivals=true to attach live arrivals to each stop (bounded by limitArrivals and limitStops). The response is a RouteStopsResponse: { route, mode, directions: [{ direction, headsigns?, stops: [...] }] }, where each stop carries an optional arrivals array when hydrated.

SDK

const routeStops = await mta.bus.routeStops({ route: 'M23' })

for (const pattern of routeStops.directions) {
  console.log(pattern.direction, pattern.stops.length, 'stops')
}
See the Routes & Stations guide.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

route
string
required
Minimum string length: 1

Query Parameters

direction
string
Minimum string length: 1
includeArrivals
boolean
limitArrivals
number
Required range: 1 <= x <= 10
limitStops
number

Maximum total stops to hydrate when includeArrivals=true.

Required range: 1 <= x <= 20
includeRaw
boolean

Response

200 - application/json

Response for status 200

route
object
required
mode
enum<string>
required
Available options:
subway,
bus
directions
object[]
required