Skip to content
Docs

Bus positions

Where MTA buses were. July 2017 to November 2024 from a public archive of the feed (a report per bus about every 2 minutes), and since October 2026 from our own collector (every 30 seconds).

Rows
2,873,762,201
Size
54.3 GB
Covers
July 2017 to November 2024 (with gaps), then October 2026 onward
Updated
Daily
Source
MTA bus GTFS-realtime vehicle positions
License
CC BY 4.0
Fileshttps://data.transitlab.nyc/v1/bus_vehicle_positions/year=YYYY/month=MM/YYYY-MM-DD.parquetOne file a day, 2,148 so far. In the database as transitlab.bus_vehicle_positions.

Rows and size from catalog.json, 2026-10-08.

One change to one bus: a bus appears, reports a new position, or drops out of the feed. Our collector fetches the MTA’s bus position feed twice a minute and keeps a row only when something changes. That keeps the table far smaller than every snapshot would be, with nothing lost.

Every row has a source.

sourceRowsHow they differ
archive14 July 2017 to 4 November 2024, with gapsFrom a public archive of the MTA bus feed. A bus has a row about every 2 minutes (the median gap is 2 minutes, the same from 2017 to 2024). observed_at equals vehicle_ts, because the archive keeps no fetch time. event is changed on every row. direction_id is null. row_id starts archive/bus/.
collector2 October 2026 onOur own collection. A bus has a row about every 30 seconds. Every column is filled and all four event values appear.

Both have the same columns and types, so one query reads both. Take care when you compare years: our own collection sees a bus four times as often, so counts of rows or reports are not comparable. Speeds, paths and trips are.

The archive has no data for some stretches. These are the days it covers:

DaysCount
14 to 19 July 20176
3 to 29 August 201727
1 to 26 September 201726
1 October 2017 to 10 November 2019771
24 May 2020 (a stub: 28 KB)1
11 October 2020 to 19 January 2021101
18 to 23 March 20216
28 March 2021 to 8 December 2022621
1 April 2023 to 4 November 2024584

Between 8 December 2022 and 1 April 2023 the archive’s daily files are empty. We have nothing from 5 November 2024 to 1 October 2026, and 3 October 2026 is missing from our own collection. Some archive days are part days (for example 1 November 2017, 8 December 2022 and the first and last days of each stretch).

A few day files end in the middle of a row (one is cut off in the archive itself, for example 26 September 2017 and 1 November 2017). We drop that one row.

The archive’s other columns are not here: empty ones, ones that never changed (stop_status, occupancy_status, congestion_level) and speed (0 from 2017 to 2019, empty after).

Every row has an event. The same scheme is used by bus predictions, service alerts and the elevator tables.

eventMeaning
baselineThe bus as seen in the first snapshot of each UTC hour. Every hour starts with a full set, so you can read any hour on its own.
addedThe bus appeared in the feed.
changedIt reported something new (here: a new vehicle_ts).
removedIt dropped out of the feed. The row repeats its last known state.

To rebuild the feed as it stood at a moment, take each bus’s latest row at or before that time and drop buses whose latest row is removed. For speeds and paths, use vehicle_ts (when the bus reported), not observed_at (when we fetched it).

SQL
-- Where were M15 buses between 8 and 9 am on 2026-10-06?
SELECT vehicle_id, vehicle_ts, lat, lon, direction_id
FROM transitlab.bus_vehicle_positions
WHERE route_id = 'M15'
AND vehicle_ts >= TIMESTAMP '2026-10-06 12:00:00' -- 8 am in New York
AND vehicle_ts < TIMESTAMP '2026-10-06 13:00:00'
AND event <> 'removed'
QUALIFY row_number() OVER (PARTITION BY vehicle_id, vehicle_ts ORDER BY observed_at) = 1
ORDER BY vehicle_id, vehicle_ts;

Each day is its own file, so one day reads fast straight from its URL. A query on transitlab.bus_vehicle_positions opens every file (more than two thousand now), so for a few days name just those files, or send the query to the SQL API with from and to, which skips the rest:

SQL
SELECT route_id, count(DISTINCT vehicle_id) AS buses
FROM 'https://data.transitlab.nyc/v1/bus_vehicle_positions/year=2026/month=10/2026-10-06.parquet'
GROUP BY route_id
ORDER BY buses DESC;
row_idvarchar

Stable ID of the row. If a row appears twice, keep one.

observed_attimestamp

When we fetched the feed snapshot this row came from (UTC).

eventvarchar

baseline, added, changed or removed. See reading change events.

vehicle_idvarchar

Bus ID as the feed gives it, e.g. MTA NYCT_8721.

vehicle_tstimestamp

When the bus reported this position (UTC).

trip_idvarchar

GTFS trip.

route_idvarchar

MTA route.

direction_idinteger

GTFS direction, 0 or 1. Null in archive rows.

start_datevarchar

Trip start date, YYYYMMDD.

latdouble

Latitude.

londouble

Longitude.

bearingdouble

Heading in degrees.

stop_idvarchar

Stop the bus is at or heading to.

sourcevarchar

archive for rows imported from the public archive (2017 to 2024), collector for rows from our own collector (2026 on).

  • A report can repeat at the top of each hour, once as baseline and once as the change before it. The QUALIFY line above keeps one per report.
  • Files are split by the UTC day of observed_at, for both sources.
  • Row counts differ by source. A full weekday of the archive has about 1.4 to 1.9 million rows (a Sunday about 1 million, a part day less); a day of our own collection has about 4.9 million. Compare buses (count(DISTINCT vehicle_id)), not rows, across the two.
  • Bus speeds explains how we turn positions into speeds; bus route speeds has the result.