# MTA API > Realtime NYC subway and bus data through one clean API. ## Docs - [MCP, llms.txt, and skill.md](https://mtaapi.dev/docs/ai/overview.md): Connect AI tools to the MTA API docs through the hosted MCP server, llms.txt / llms-full.txt files, and an installable Claude skill — all generated automatically. - [mta.alerts.current() — active MTA service alerts](https://mtaapi.dev/docs/api-reference/alerts.md): Reference for mta.alerts in mta-js. Retrieve current MTA service alerts—delays, planned work, and route suspensions—for subway or bus. - [mta.bus.vehicles() — live bus positions by route](https://mtaapi.dev/docs/api-reference/bus.md): Reference for mta.bus in mta-js. Retrieve live bus vehicle positions, GPS coordinates, heading, next stop, and occupancy for any MTA route. - [mta.bus.arrivalBoard() — nearby bus departure board](https://mtaapi.dev/docs/api-reference/bus-arrival-board.md): Reference for GET /api/v1/bus/arrival-board. Find nearby bus stops and group their upcoming arrivals by route in a single request. - [mta.bus.routeStops() — ordered stops on a route](https://mtaapi.dev/docs/api-reference/bus-route-stops.md): Reference for GET /api/v1/bus/routes/{route}/stops. Get the ordered stops a bus route serves, optionally hydrated with arrivals. - [mta.subway.direction() — resolve a destination to a direction](https://mtaapi.dev/docs/api-reference/direction.md): Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label. - [mta-js SDK reference: all namespaces and methods](https://mtaapi.dev/docs/api-reference/overview.md): Explore the full mta-js SDK method surface, organized by namespace: subway arrivals, bus positions, service alerts, and nearby stop lookups. - [mta.routes.list() — list subway and bus routes](https://mtaapi.dev/docs/api-reference/routes.md): Reference for GET /api/v1/routes. List the catalog of subway and bus routes, with names, colors, and transit mode. - [mta.stops.near() — find stops by geolocation](https://mtaapi.dev/docs/api-reference/stops.md): Reference for mta.stops methods in mta-js. Find nearby MTA subway and bus stops sorted by distance from any latitude and longitude. - [mta.stops.byIds() — batch stop lookup](https://mtaapi.dev/docs/api-reference/stops-batch.md): Reference for GET /api/v1/stops. Resolve multiple stop IDs in a single request, preserving request order, optionally with served routes. - [mta.subway.arrivals() — real-time subway predictions](https://mtaapi.dev/docs/api-reference/subway.md): Reference for mta.subway in mta-js. Fetch real-time arrival predictions for any subway stop and route, with Unix timestamps and direction of travel. - [mta.subway.arrivalBoard() — nearby subway departure board](https://mtaapi.dev/docs/api-reference/subway-arrival-board.md): Reference for GET /api/v1/subway/arrival-board. Find nearby subway stations and group their upcoming arrivals by direction in a single request. - [mta.subway.routeStations() — ordered stations on a route](https://mtaapi.dev/docs/api-reference/subway-route-stations.md): Reference for GET /api/v1/subway/routes/{route}/stations. Get the ordered stations a subway route serves, optionally hydrated with arrivals. - [Get your API key and authenticate requests](https://mtaapi.dev/docs/authentication.md): Learn how to get your free MTA API key, store it as an environment variable, and pass it to the mta-js client to authenticate every request. - [Stop IDs, route IDs, and the MTA data model](https://mtaapi.dev/docs/concepts/data-model.md): Learn how mta-js represents stops, routes, vehicles, and alerts—and how to find and use MTA stop IDs and route IDs in your SDK requests. - [mta-js architecture: client model and namespaces](https://mtaapi.dev/docs/concepts/overview.md): Understand mta-js's unified client model, how it connects to MTA's GTFS-RT data feeds, and how the four namespaces are organized. - [Real-time data feeds and update frequency](https://mtaapi.dev/docs/concepts/real-time-feeds.md): Learn how mta-js fetches live MTA GTFS-RT feeds, how often data refreshes, and what to expect when feeds are delayed or unavailable. - [Configure the mta-js client and options](https://mtaapi.dev/docs/configuration/setup.md): Customize the mta-js client with options for database backend, response cache duration, and request timeouts to fit your application's needs. - [Build a live departure board](https://mtaapi.dev/docs/guides/arrival-boards.md): Use mta.subway.arrivalBoard() and mta.bus.arrivalBoard() to render a departure board: the nearest stops to a coordinate, each with its next arrivals grouped by direction or route. - [Track live bus vehicle positions by route](https://mtaapi.dev/docs/guides/bus-tracking.md): Use mta-js to get real-time vehicle positions for any MTA bus route, including GPS coordinates, heading, next stop, and occupancy status. - [Turn a rider's destination into a direction](https://mtaapi.dev/docs/guides/direction.md): Use mta.subway.direction() to resolve a rider-facing destination like "Union Sq" into the north/south feed direction, then feed it straight into subway arrivals. - [Find MTA stops near any latitude and longitude](https://mtaapi.dev/docs/guides/nearby-stops.md): Use mta-js to discover nearby subway and bus stops for a given latitude and longitude, with support for filtering by transit mode. - [List routes, stations, and stops](https://mtaapi.dev/docs/guides/routes-and-stations.md): Use mta.routes.list(), mta.subway.routeStations(), mta.bus.routeStops(), and mta.stops.byIds() to build route pickers, route maps, and hydrate saved stops. - [Fetch MTA service alerts and disruptions](https://mtaapi.dev/docs/guides/service-alerts.md): Fetch current MTA service alerts for subway and bus using mta-js. Filter by route and severity to surface delays and service changes in your app. - [Fetch and display real-time subway arrivals](https://mtaapi.dev/docs/guides/subway-arrivals.md): Fetch live subway arrival predictions for any MTA stop and route using mta-js, process timestamps, and display upcoming trains in your app. - [Get started with mta-js](https://mtaapi.dev/docs/index.md): mta-js is a TypeScript SDK for NYC transit data. Install it, get your MTA API key, and make your first real-time subway arrival request in minutes. ## OpenAPI Specs - [json](https://www.mtaapi.dev/api/v1/openapi/json) - [openapi](https://mtaapi.dev/docs/openapi.json)