back

by eric_khun·6y ago·view on hn ↗
- Which API would you recommend to get accurate transit information data?

- Is there any article talking about and path optimization including time constraint? I've done something homemade (a mix of bird flight distance and time to destination) it looks "okay" but I'm sure can be better.

I've just built a tool to calculate directions for long flights layover [1], but the Google Maps API Directions sometimes lack of those data (Tokyo/Singapore/Istanbul for example). Any recommendations appreciated!

[1] https://travelhustlers.co/layover-in/

2 comments
I would see if your system has a gtfs feed.

https://developers.google.com/transit/gtfs/

You could use pgrouting for routing.

https://pgrouting.org/

GTFS and GTFS-RT definitely work, but in practice it seems each transit agency implements them a little differently.

I'm actually a fan of the HERE Transit API. They've done the work of interfacing with a bunch of providers, and you can query their whole dataset with a REST API. Unfortunately it's proprietary and only free at small volumes. But I found it much easier to hook up than working directly with a transit agency.

That said, their coverage can be a bit random. For example, I ended up having to do direct GTFS-RT anyway because HERE doesn't seem to have real-time data for NYC subways.

Not a transit routing API, but transit.land offers aggregated transit network data as a service. https://transit.land/