Beyond realtime arrivals, mta-js exposes the catalog behind the system: the list of routes, the ordered stations on a subway line, the ordered stops on a bus route, and batch lookups to resolve stop IDs you already have. Use these to build route pickers, draw a route map, or hydrate saved stop IDs into names and coordinates.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.
These endpoints require a hosted
apiKey. See Authentication to get one.Prerequisites
mta-jsinstalled (npm install mta-js)- An MTA API key set as
MTA_API_KEYin your environment
List routes for a picker
mta.routes.list() returns the route catalog. Pass the modes you care about, or omit for everything.Get the ordered stations on a subway route
mta.subway.routeStations() returns the route’s stop patterns. Pass a direction to order them in the rider’s direction of travel.Get the ordered stops on a bus route
mta.bus.routeStops() is the bus equivalent, returning ordered stops grouped by direction.These guides use the SDK. For the raw REST endpoints, see Routes, Subway Route Stations, Bus Route Stops, and Stops by ID.