Issue1
Chelsea
Flatiron
Stuy Town
May 28, 2026 / Gary Tokman
Build a Realtime NYC Transit Map with MapKit JS and mta-js
A practical walkthrough for plotting live MTA vehicle locations on a New York City map using the mtaapi.dev API and SDK.
Realtime NYC subway and bus data through one clean API. Arrivals, stops, alerts, and vehicle locations.
Fetch realtime arrivals, alerts, stops, and vehicle locations with clean SDK or HTTP calls.
import { MTA } from 'mta-js'const mta = new MTA({apiKey: process.env.MTA_API_KEY})// Get display ready subway arrivalsconst arrivals = await mta.subway.arrivals({stopId: 'L06',route: 'L'})// Resolve rider-entered destinations to GTFS-backed directionsconst direction = await mta.subway.direction({route: 'L',fromStopId: 'L06',destination: 'Union Sq'})// Get display ready bus arrivalsconst buses = await mta.bus.arrivals({stopId: '404099',route: 'M23'})// Find route-aware nearby stopsconst stops = await mta.stops.near({lat: 40.7356,lon: -73.9804,modes: ['subway', 'bus'],route: 'M23',limit: 10})// Track buses on a routeconst vehicles = await mta.bus.vehicles({route: 'M23',limit: 5})
Built for developers who want to build with MTA data without the headaches.
Self-host for free, or use hosted keys with limits sized for real apps.
View our blog for examples on how to build apps with the API.
May 28, 2026 / Gary Tokman
A practical walkthrough for plotting live MTA vehicle locations on a New York City map using the mtaapi.dev API and SDK.