# mta.jamestannahill.com — Full Content Index ## Identity - **Name:** Subway Intel - **URL:** https://mta.jamestannahill.com/ - **Operator:** James Tannahill (https://jamestannahill.com) - **Focus area:** Midtown Manhattan, New York City (all NYC subway lines covered) - **Update cadence:** MTA GTFS-Realtime polled every 30 seconds; WebSocket push to browsers on each cycle ## Product summary Subway Intel transforms MTA GTFS-Realtime protobuf feeds into a consumer dashboard with six views: network-wide line health, personal saved-station boards, geolocated nearby stations, heuristic delay intelligence, a Mapbox live train map, and point-to-point trip planning with one-transfer fallback. Unlike the official MTA app, Subway Intel emphasizes: - Per-line **Network Pulse** with NOMINAL / DELAYED / DISRUPTED status derived from live headways - **Delay Intel** heuristics that surface delays from trip-update deviation before official alerts propagate - **Track diagrams** with interpolated train positions and YOU ARE HERE markers - **Arrival feedback loop**: users confirm train presence (HERE? Y/N); corrections adjust displayed countdowns per route - **Smart commute** timing via `/api/commute` with multi-parent-stop expansion for complex stations (e.g. Times Sq-42 St) ## Views and hash routes | Route | Purpose | |---|---| | `#/pulse` | Network Pulse — line health summary, worst offenders, expandable line-group accordion, saved-line badges, track diagram | | `#/stations` | My Stations — user-saved stops with uptown/downtown/both direction filter, live m:ss countdowns | | `#/nearby` | Nearby — GPS or address search, 3 nearest stations, select for arrivals + diagram; `?near=STOP_ID` deep link | | `#/intel` | Delay Intel — heuristic signals across all live arrivals; filterable by saved lines | | `#/map` | Live Map — Mapbox GL JS, NYC DOT track GeoJSON, live vehicle positions via WebSocket | | `#/plan` | Plan Trip — origin/destination search, live departure options, transfer details | ## Data pipeline ``` MTA GTFS-RT feeds (protobuf, per line group) + camsys alerts JSON │ ▼ FastAPI backend (Python, EC2) • ETag + content-hash skip for unchanged feeds • parse_feed → trip updates / arrivals • parse_vehicle_positions → live train locations • parse_alerts + parse_alerts_json → service alerts • LiveState in-memory aggregation • WebSocket broadcast (/ws) on every poll • TimescaleDB writer (historical positions + alerts) │ ▼ React 19 SPA (Vite, TypeScript, Mapbox GL JS) ``` ## Line groups ingested 1, 2, 3, 4, 5, 6, 7, S (shuttle), A, C, E, B, D, F, M, G, J, Z, L, N, Q, R, W, SIR (Staten Island Railway) ## API reference Base: `https://mta.jamestannahill.com` ### Live data - `GET /api/stations/{stop_id}/arrivals` — `{ stop_id, arrivals: [{ route_id, arrival_time, delay_sec, direction }] }` - `GET /api/network` — `{ lines: [{ route_id, status, avg_delay_sec, headway_variance, alerts }] }` - `GET /api/delay-intel` — `{ signals: [...] }` heuristic delay objects - `WS /ws` — full LiveState JSON snapshot on connect and every poll ### Static / lookup - `GET /api/stops/search?q=` — station name autocomplete - `GET /api/stops/nearest?lat=&lon=&limit=` — haversine nearest parent stops - `GET /api/stops/all` — all parent stations (1h cache) - `GET /api/tracks` — track geometry GeoJSON (1h cache) - `GET /api/subway-lines` — NYC ArcGIS physical line GeoJSON (24h cache) - `GET /api/routes/{route_id}/stops?direction=` — ordered stop sequence ### Trip planning - `GET /api/commute?origin=&destination=` — direct or one-transfer options with `compute_departure` timing ### Feedback - `POST /api/feedback/arrival` — `{ stop_id, route_id, scheduled_arrival, train_present }` - `GET /api/feedback/corrections` — per-route bias corrections applied to countdowns ### Config - `GET /api/config` — `{ mapbox_token }` for Map view ## Heuristics **Line health status:** Derived from average delay seconds and headway variance per route vs. nominal patterns. States: NOMINAL, DELAYED, DISRUPTED. **Delay Intel signals:** Computed from all in-memory arrivals — headway gaps, schedule deviation, bunching detection. **Commute departure:** `compute_departure(next_arrival, travel_sec)` recommends leave-in minutes based on walking buffer and live delay. ## Static pages (crawlable) - `/` — SPA shell with JSON-LD WebSite + WebApplication schema - `/docs.html` — technical documentation (this content in HTML form) - `/llms.txt` — concise AI index - `/llms-full.txt` — this file - `/sitemap.xml` — URL index - `/robots.txt` — allow all, sitemap reference - `/manifest.json` — PWA manifest ## Social / SEO - Open Graph + Twitter Card meta on `/` - OG image: https://mta.jamestannahill.com/og.png (1200×630) - Canonical: https://mta.jamestannahill.com/ - `` in document head ## License See repository LICENSE. MTA GTFS data subject to MTA terms of use. ## Related properties by same operator - Weather: https://wx.jamestannahill.com/ - Personal site: https://jamestannahill.com/