← Software

Bustle

every bus in NYC, live

A map of New York City covered in thousands of colored bus markers, each on its route

Every bus in New York City on one map. Each bus is a little colored capsule on its route, moving as the MTA reports it. Click a stop for its next arrivals, or a bus for where it’s headed, how late it is and where it stops next.

Behind the map is a small streaming system. The MTA’s realtime feed goes into Kafka, a stop-events service works out when each bus actually reached each stop, and everything lands in Postgres. Arrival predictions come from the bus’s last position, the distance left along its route and how fast it has really been moving over the last fifteen minutes, stops included.

Those stop arrivals add up to Bus Stats: a report card for the whole system and every route. How many arrivals are on time, how often you wait longer than the schedule promises, how often buses bunch up, the typical delay and the real average speed. Lately it’s been about 8 miles an hour.

It also has health checks every two minutes, alerts when buses stop arriving, nightly backups and a weekly refresh of the MTA’s schedule.

buses.jordansucher.com ↗Bus Stats ↗

Measures
On-time arrivals, wait times, bunching, delay and speed for every route
Scale
Millions of stop arrivals a week across 300+ routes
Built with
Kafka, Python, Postgres, Leaflet, Mapbox, Nginx, Grafana, Prometheus, Metabase, Docker
Street-level view in Brooklyn: buses as small colored capsules moving along their route lines, with stops as white dotsThe Bus Stats page: 47% on time, 82% wait OK, 7% bunched, 1:54 typical delay, 8.1 mph average speed, 5.5 million stop arrivals measured, and an on-time chart by hour
The live map on a phone