An arrival board answers “what’s leaving near me, right now?” in a single call. Instead of finding nearby stops and then making one arrivals request per stop,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.
mta.subway.arrivalBoard() and mta.bus.arrivalBoard() return the closest stations to a coordinate with their upcoming arrivals already attached and grouped — perfect for a lobby screen, a “near me” tab, or a kiosk.
Arrival boards 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
Fetch the subway board for a location
Pass a
lat / lon and how big you want the board. limitStations caps how many stations come back (max 20); limitArrivals caps arrivals per direction (max 10).Render each station and its directions
Each entry has a
station, its distanceMeters, and a directions array. Each direction bundles a direction, an optional headsign, and that direction’s arrivals.Prefer the raw REST shape? See the Subway Arrival Board and Bus Arrival Board API reference pages.