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

fetch('https://www.mtaapi.dev/api/v1/subway/routes/{route}/stations', 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 stations a subway route serves. Pass the route in the path (for example L) and an optional direction to order stations in the rider’s direction of travel. Set includeArrivals=true to attach live arrivals to each station (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 stations = await mta.subway.routeStations({ route: 'L', direction: 'north' })

for (const pattern of stations.directions) {
  for (const stop of pattern.stops) {
    console.log(stop.name)
  }
}
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