Tracking Ghost Buses Across 43 Transit Networks with GTFS-RT and Cloudflare Workers
Nov 17, 2026If you ride the bus, you've seen a ghost bus: the arrival board counts down from 6 minutes to "Due," and then the trip vanishes while you're standing at the stop.
I built Ghost Bus Tracker (live dashboard) to measure how often that actually happens—starting with Metro Transit in Minneapolis–Saint Paul and expanding to 43 transit agency presets across the US and Canada (38 of which scan live with no API key).
How it detects a ghost bus
Most transit apps trust TripUpdates.pb on its own. Ghost Bus Tracker cross-checks TripUpdates.pb against VehiclePositions.pb in real time:
- Ghost trip: A scheduled trip appears in
TripUpdateswith no assigned vehicle transponder and no active GPS broadcast—or its assigned vehicle ID is missing fromVehiclePositions. - Canceled (not a ghost): Trips explicitly marked
CANCELEDare bucketed separately so they aren't conflated with unannounced phantom runs. - On-time & early departures: Tracked trips are scored against the standard
-1mto+5m(-60sto+300s) window, with early departures (< -60s) called out separately since arriving on time to a bus that already left is its own failure mode. - Excess Wait Time (EWT): Estimates extra rider wait time caused by bunching and irregular spacing from delay variance per route and direction.
For example, in today's Metro Transit snapshot (2026-11-17T07:00Z, 58 active trips), the ghost bus rate was 0.0%—every scheduled trip had a live transponder—yet 29.3% of trips (17 of 58) were early departures more than a minute ahead of schedule, bringing on-time adherence to 62.07%.
Architecture: Workers + R2 + D1 + Git-Scraping
Instead of running a heavy backend or GitHub Actions cron, the production pipeline runs entirely at the edge on Cloudflare:
- 30-minute scan cron: A Cloudflare Worker (
worker/src/scan.js, ported from the Python analyzer) fetches binary GTFS-RT Protocol Buffer feeds, classifies every trip, and computes route-level rankings. - R2 + D1: Each scan writes a snapshot and
latest.jsonpointer to R2 and upserts summary rows into D1 to serve the live dashboard. - Daily Git-scraping archive: Once a day, the Worker renders
RELIABILITY*.mdand commitsdata/latest/*.json,data/history/*.json, and the Markdown reports back to GitHub via the Git Data API—turning Git history into an auditable time-series archive.
Check out the live numbers at ghost-bus-tracker.a-8c6.workers.dev or the source on GitHub.