The Unified API for Transit

Realtime NYC transit 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
})
// Display-ready subway arrivals
const arrivals = await mta.subway.arrivals({
stopId: 'L06',
route: 'L'
})
// Nearby subway and bus stops
const stops = await mta.stops.near({
lat: 40.7356,
lon: -73.9804,
modes: ['subway', 'bus'],
limit: 10
})
// Live bus positions on a route
const vehicles = await mta.bus.vehicles({
route: 'M23',
limit: 5
})
// Same client for PATH, NJ Transit, LIRR, NYC Ferry, and Citi Bike
const path = await mta.path.arrivals({
station: 'JSQ',
direction: 'to-ny'
})

Live Transit Data for AI Agents

Give Claude, ChatGPT, Cursor, Codex, v0, and Devin live NYC transit data over MCP.

Terminal
claude mcp add --transport http mta https://www.mtaapi.dev/mcp \
--header "Authorization: Bearer $MTA_API_KEY"

MCP setup for Cursor, Claude, and ChatGPT

Everything You Need

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

Built-in MCP Server
Connect Claude, ChatGPT, Cursor, or Codex to the hosted MCP server and query live transit data as agent tools.
Display Ready Arrivals
Live subway, bus, commuter rail, PATH, and ferry arrivals include readable stop names, destinations, and direction text.
Route-Aware Stops
Find nearby subway, bus, rail, PATH, and ferry stops that serve the route your app needs, with route metadata included.
Vehicle Locations
Track buses, NJ Transit trains, and NYC Ferry boats with live positions, vehicle IDs, and destinations.
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
  • MCP server for AI agents
  • 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
  • MCP server for AI agents
  • Priority email support
Start free trial