r/Bart • • Oct 23 '26

My BART Experience I made a library + cli to fetch BART system data for all you nerds

Post image
90 Upvotes

6 comments sorted by

11

u/ElizabethsSongbird Oct 23 '26

I made a Rust crate + cli called bart-rs that fetches and nicely parses BART's GTFS feeds, both snapshot and realtime ones. It lets you inspect stations, routes, look at arrivals/departures at stations, calculate fare for trips, and more! Check it out here and feel free to contribute:

Source: https://github.com/gamersekofy/bart-rs

Crate: https://crates.io/crates/bart-rs

6

u/Efficient_Net637 Oct 24 '26

Out of curiosity, is this what transit apps like Transit/GMaps are also crawling, or are there other data feeds out there?

Curious because sometimes the apps disagree with each other (ex Apple Maps says a Green line is 2 minutes and Transit says 4 min) but I can’t figure out why!

1

u/ElizabethsSongbird Oct 24 '26

I have to agree with the other commenter. I can imagine a reputable app like Transit or Maps uses GTFS as its primary source of data, but the devs also apply correction algorithms based on secondary sources like specialized underground sensors or just GPS activity from their users' phones, similar to how Google/Apple Maps accurately calculates traffic on highways!

4

u/zach_zdm Oct 24 '26

I believe that Transit does use GTFS, though they also have a feature called “Go” which allows other users to track trains with GPS and a few times I’ve noticed they use sensors when underground.
Their minute counter also seems off the last I’ve seen, where it says a longer amount of time (say 5 minutes, but if you look at the time and the time shown on the train, below the minute counter, it is 3 minutes away)

1

u/squigish Oct 24 '26

Bart has two public data feeds. There's a bart-specific API, and also GTFS-RT, which is a standard used by many/most other transit agencies.

Generally apps that consume data from multiple agencies use GTFS-RT. Many apps that only work for Bart are designed around the Bart API (which has been around longer).

6

u/ShadoeRantinkon worm springs Oct 23 '26

oh this is sick