ACEBDFMG1234567NQRWL

The Unified API for MTA

Realtime NYC subway and bus data through one clean API. Arrivals, stops, alerts, and vehicle locations.

Get Started
$npm i mta-js

Simple, Intuitive API

Fetch realtime arrivals, alerts, stops, and vehicle locations with clean SDK or HTTP calls.

app.ts
import { MTA } from 'mta-js'
const mta = new MTA({
apiKey: process.env.MTA_API_KEY
})
// Get display ready subway arrivals
const arrivals = await mta.subway.arrivals({
stopId: 'L06',
route: 'L'
})
// Resolve rider-entered destinations to GTFS-backed directions
const direction = await mta.subway.direction({
route: 'L',
fromStopId: 'L06',
destination: 'Union Sq'
})
// Get display ready bus arrivals
const buses = await mta.bus.arrivals({
stopId: '404099',
route: 'M23'
})
// Find route-aware nearby stops
const stops = await mta.stops.near({
lat: 40.7356,
lon: -73.9804,
modes: ['subway', 'bus'],
route: 'M23',
limit: 10
})
// Track buses on a route
const vehicles = await mta.bus.vehicles({
route: 'M23',
limit: 5
})

Everything You Need

Built for developers who want to build with MTA data without the headaches.

Agent Friendly API
The API and SDK are shaped for AI tools like Codex, Claude Code, and Cursor, saving tokens.
Display Ready Arrivals
Live subway and bus arrivals include readable stop names, destinations, and UI-ready direction text.
Route-Aware Stops
Find nearby stops that actually serve the train or bus route your app needs, with route metadata included.
Vehicle Locations
Track buses on a route with live positions, vehicle IDs, stops, and destination labels.
Service Alerts
Get instant notifications about delays, planned work, and service changes.
Production Guardrails
Built-in caching, normalized route aliases, and stable response shapes for shipped apps.

Simple Pricing

Self-host for free, or use hosted keys with limits sized for real apps.

Self-Hosted
Use mta-js directly and run it on your own infrastructure
Free
  • Direct mta-js access
  • Deploy anywhere
  • Unlimited requests
  • Community support
  • MIT License
View on GitHub
Indie API
7-day free trial
Managed HTTP API for shipped side projects and prototypes
$19/mo
  • 250k requests per month
  • 600 requests per minute
  • Realtime arrivals and alerts
  • Route-aware nearby stops
  • OpenAPI docs and generated clients
  • Email support
Start free trial
Pro API
7-day free trial
Higher limits for production apps and internal tools
$79/mo
  • 2M requests per month
  • 2,400 requests per minute
  • Route-aware stop lookup
  • Bus vehicle locations
  • Usage analytics
  • Priority email support
Start free trial