NYC subway daily ridership: about 3.6M rides a day. Find any station's riders and busiest hour, see the busiest subway stations in NYC and an animated subway map. Updated daily from MTA open data.
翻譯準備中
資料PHP · JavaScriptGitHub @MantieReid上線中營運者未確認
試用過了嗎? 點一下就好,不需要登入。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證NYC subway ridership 2025–2026 from MTA open data: busiest stations, rush hours, unusual days and an animated map. Reproducible Python analysis + WordPress plugin.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗How New York rides the subway: the busiest stations, rush hours, seasons, unusual days, and an animated map of a day on the subway, built from the MTA's hourly ridership data.
Live demo: mantiereidii.com/mta-ridership, updated daily.
By Mantie Reid II. Free to reuse with credit (CC BY 4.0).
| 2026 vs 2025 | Fares and the MetroCard |
|---|---|
| Riders by hour of day | Riders per month |
|---|---|
| Riders by day of week | Top stations by season |
|---|---|
NYC subway ridership for 2025 and 2026 to date, from MTA's open data. It includes:
mta_ridership.py: a Python script that writes small JSON/CSV summaries and PNG charts.wordpress-plugin/: a WordPress plugin that shows the same trends on a web page and refreshes them daily.Source: MTA Subway Hourly Ridership: Beginning 2025
(data.ny.gov dataset 5wq4-mkjj). Neither tool downloads the full CSV (40M+ rows). They
ask the data.ny.gov API to add up the rows first and download only the totals.
Requirements: Python 3.9+ and an internet connection. No account or API key is needed.
git clone https://github.com/MantieReid/mta-data-analysis.git
cd mta-data-analysis
pip install -r requirements.txt
python mta_ridership.py
This writes everything to output/. A first run takes a few minutes. After that, the
downloaded totals are cached in output/*_cache.csv (not committed). On later runs the daily
station totals are updated incrementally: the last 30 days are downloaded again and replace the
cached ones (new days arrive, and any MTA revisions to those days are picked up); use
--refresh to download everything again.
Options:
| Flag | What it does |
|---|---|
--week YYYY-MM-DD | Also writes output/week_<monday>.json: riders per station for that week |
--refresh | Ignore the cache and query the API again |
--reconcile-days N | How many recent days to download again on a cached run (default 30, 0 = off) |
--no-charts | Skip the PNG charts |
pip install pytest pyflakes
python -m pytest tests # Python tests; the Python/PHP comparison runs if PHP is installed
php tests/php/run_tests.php # plugin tests (plain PHP, no WordPress or database needed)
The tests use small made-up data in tests/fixtures/ and never call the MTA's API. They cover rounding,
dates and seasons, unusual-day detection, holidays, and re-checking recent days (re-running is
idempotent, revised days overwrite old values, a revision changes the trend). The plugin tests also
cover the run lock, step status, failure alerts and data health. tests/test_parity.py runs the same
input through Python and PHP and checks they agree. GitHub Actions runs everything on every push
(.github/workflows/ci.yml), on PHP 7.4 and 8.3.
tests/php/live_reconcile_check.php is an optional live check (not run in CI): it runs the re-check
against the real API on a copy of a site's stored history and reports any MTA revisions.
Optional: set the SOCRATA_APP_TOKEN environment variable to a free
Socrata app token to avoid throttling.
The committed output/ files are a snapshot of data through Oct 14, 2026.
system_monthly.json records the date the data runs through. If you run the script later,
your numbers will differ:
To compare like for like, look at periods that were complete in both runs. Rows marked
"partial": true (months, weeks, seasons and years with missing days) will change.
ridership column (entries into the station), transit_mode = 'subway',
grouped by station_complex_id.Station trends (the script and the WordPress plugin use the same method and get identical results):
transfers column, last 365 days.mta_ridership.py (EVENTS) and the plugin (includes/calendar.php).| File | Contents |
|---|---|
station_monthly.csv | Riders per station per month, with a partial flag |
station_month_avg.csv | Average riders per month per station (complete months only) |
system_monthly.json | System-wide monthly totals and the average month |
weekly.csv / weekly.json | Weekly totals and average riders per station |
seasons.json | Average weekly riders per season |
station_yearly.csv, yearly.json | Yearly totals per station, top 10 per year |
day_of_week.json | Average daily riders per weekday, per year |
station_hourly_avg.csv, system_hourly_avg.json, month_hourly_avg.json | Average riders per hour of day |
station_seasonal.csv, seasonal_top5.json | Season totals per station, top 5 per season |
top_stations_latest.json | Top 5 stations on the latest day of data and over the last 7 days |
unusual_days.json | Unusually busy and quiet days per station: the last 14 days and the biggest per year, each with its daily riders around the day |
weekend_vs_weekday.json | Stations busiest on weekends vs mostly weekday, last 364 days |
late_night.json | Stations with the largest share of riders between midnight and 5 AM, last 365 days |
transfers.json | Stations with the most transfers, last 365 days |
calendar.json | Riders per day vs a normal day for that weekday (median of the 26 weeks before), with holidays, storms and events labeled |
extras.json | Map data (each station's location and average riders per hour, last 8 weeks), this year vs last year (total, by borough, biggest station changes), the station lookup (every station's average riders a day over the last 365 days, rank and change vs last year), fare types (last 365 days) and OMNY vs MetroCard by month |
charts/*.png |
The plugin also has a congestion pricing page, [mta_congestion]
(live), built from
MTA Congestion Relief Zone Vehicle Entries and the
zone outline. It shows the tolls with a calculator (E-ZPass rates from
mta.info), the zone map, vehicles entering per hour, this year vs last year on the same days (Jan 5 to the
latest day, since tolling began Jan 5, 2025), every bridge and tunnel, entries by vehicle type, and subway
ridership at stations inside the zone vs outside (a station is inside if its location falls within the outline).
[mta_lines] (live) ranks every subway line by on-time rate and gives each
line a report card at /subway-lines/<line>/ (for example the B train).
It combines five MTA monthly datasets: Terminal On-Time Performance,
Customer Journey-Focused Metrics, Trains Delayed,
Wait Assessment and Major Incidents.
[mta_buses] (live) ranks NYC bus routes (busiest, slowest, least reliable,
most bus-lane camera violations) and gives each route a report card at /bus-routes/<route>/
(for example the M15 Select Bus Service).
See wordpress-plugin/README.md. In short:
wordpress-plugin/mta-ridership.zip under Plugins → Add New → Upload Plugin.[mta_ridership] to a page.Everything in this repo (code, output files and charts) is licensed under CC BY 4.0 (full text). You can use, share and change it for any purpose, including commercially, as long as you give credit.
How to credit, for example under a chart or in an article:
NYC subway ridership analysis by Mantie Reid II, https://github.com/MantieReid/mta-data-analysis (CC BY 4.0)
Say if you changed anything. GitHub's "Cite this repository" button (from CITATION.cff)
gives the same credit in APA and BibTeX formats.
The underlying ridership data is published by the MTA on data.ny.gov and isn't covered by this license.
| Charts of the above |