Skip to main content
GET
https://www.mtaapi.dev
/
api
/
v1
/
routes
List static routes
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://www.mtaapi.dev/api/v1/routes', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
[
  {
    "id": "<string>",
    "shortName": "<string>",
    "longName": "<string>",
    "type": 123,
    "color": "<string>",
    "textColor": "<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 catalog of routes in the hosted stops snapshot. Pass a comma-separated modes filter (for example subway,bus) to scope the list, or omit it for every mode. Each entry is a Route plus a mode: { id, shortName?, longName?, color?, textColor?, type?, mode }. Use it to populate a route picker or hydrate route metadata client-side.

SDK

const routes = await mta.routes.list({ modes: ['subway', 'bus'] })

for (const route of routes) {
  console.log(route.shortName ?? route.id, route.mode)
}
See the Routes & Stations guide.

Authorizations

Authorization
string
header
required

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

Query Parameters

modes
string

Comma-separated transit modes to include, such as subway,bus.

Response

200 - application/json

Response for status 200

id
string
required
mode
enum<string>
required
Available options:
subway,
bus
shortName
string
longName
string
type
number
color
string
textColor
string