Hacker News new | past | comments | ask | show | jobs | submit login

Very nice. Given the smoothness, I first thought this was real-time:) As someone who lives in Berlin, I didn't know there was an open API for the VBB. I'll have to have a look at it.

And loving the Minimetro vibes! (Running this on android 10 on a OnePlus 7pro - runs smooth in Chrome)




I too thought for a moment that this was real-time until I noticed the absolutely frighting speed at which these trains would be passing through the tubes.

People waiting at a station would be sucked onto the tracks by the vortex created in the wake of a passing train. The front of the trains would probably be red hot with friction, while the passengers would be screaming until their train reached the end of the line, where it would pass out of existence, presumably into another dimension.

That is, until god slowed reality back down to 1x speed.


I don't know if VBB used this, but most transit agencies publish their data in two standard formats these days GTFS for static schedules and GTFS-real time for real-time data. Any application you build around these formats would immediately scale to pretty much every big city.

Google maps and Apple maps provide transit directions in their apps using GTFS and GTFS real time data (partly the reason why Apple maps was able to add transit directions feature so easily - Google had to deal with the transit agencies years before that and convinced them to publish data in open source standard formats).


VBB has been publishing GTFS (Static/Schedule) data for almost 10 years now. [1][2]

But there is no (truly open) realtime data (e.g. GTFS Realtime or SIRI) available because their API [3] - requires signing a draconian contract (e.g. ridiculous liability clauses, no permission to pass the data on in any form), and - API works individual vehicles/trips, so you'd have to poll every single one out there to get the equivalent of a GTFS-RT dataset.

There is an unofficial API though [4][5] that is de-facto open, and I have built a tool that pools the data and creates a GTFS-RT feed. [6]

[1] https://daten.berlin.de/datensaetze/vbb-fahrplandaten-gtfs [2] https://www.golem.de/news/open-data-verkehrsverbund-berlin-b... [3] https://www.vbb.de/vbb-services/api-open-data/api/ [4] https://github.com/public-transport/hafas-client/tree/5.25.0... [5] https://github.com/public-transport/transport-apis/blob/8e05... [6] https://github.com/derhuerst/berlin-gtfs-rt-server


Agreed on the minimetro feel!

I thought it was live too, I wonder if there's a way to do that? I like that you can see both the s and u bahn, though I kind of wish the abstract map would carry over.


Thanks a lot for the feedback!! The "live mode" is already developed using hafas-client[1] and VBB-API[2]. I just asked VBB to give me API access, I'll release the feature when I get it. If you are interested, VBB already made a live map[3]

1: https://github.com/public-transport/hafas-client 2: https://www.vbb.de/vbb-services/api-open-data/api/ 3: https://www.vbb.de/fahrinfo/


Author of hafas-client here!

Do you know about v5.vbb.transport.rest's /radar API [1]? Because it wraps VBB's de-facto-open unofficial API [2][3], it doesn't require authentication or even signing a contract.

If you have problems using it, please get in touch with me!

[1] https://v5.vbb.transport.rest/api.html#get-radar [2] https://github.com/public-transport/hafas-client/tree/5.25.0... [3] https://github.com/public-transport/transport-apis/blob/8e05...


Hi, I know you! You're hard to miss when working on public transportation. Very happy to see you're looking at my project! I sent you an email.

v5.vbb.transport.rest's frames were missing something I needed, if I recall correctly. With a fork of hafas-client, I got something to work okay. I was going to release it too, but then I realised I should use another user agent than 'my-awesome-program' which only VBB can provide, I think.


> v5.vbb.transport.rest's frames were missing something I needed, if I recall correctly. With a fork of hafas-client, I got something to work okay.

It would be great if you could create an Issue in hafas-client about this, so everyone can benefit from the changes.

> I realised I should use another user agent than 'my-awesome-program' which only VBB can provide, I think

If you're talking about hafas-client: No, you can use anything! It's merely about being transparent towards VBB who/what is using their API, but they don't have to approve it beforehand; They can't in fact, because the "mobile" HAFAS API just uses a static auth token.


Oh okay. Here is an old version of Ubähnchen with the toggle for "live mode / planned mode" on the top right: https://ubahnchen-inona1te6-lzear.vercel.app/?live The URL parameter still works in the current version by the way.

When I changed 'my-awesome-program' to 'ubahnchen' or something else when creating the hafas-client, it stopped getting valid responses. So I thought I should wait for VBB to give me an ID that works.


> When I changed 'my-awesome-program' to 'ubahnchen' or something else when creating the hafas-client, it stopped getting valid responses.

Please report this as an Issue in the hafas-client repo, so we can discuss this further.

> So I thought I should wait for VBB to give me an ID that works.

This is not how it works: - The official VBB API is an entirely different API, which they give you an auth token for when you ask. - hafas-client uses the "mobile" API, which has a static universal auth token. But it sends a (slightly randomised) User-Agent in order to communicate who/what is making requests. It might be that some User-Agents are blocked.


There is definitely a way to do it, actually the Munich S-Bahn has a realtime map : https://www.s-bahn-muenchen.de/fahren/live-map - not as smoothly animated though, and I'm not sure if the data used there is publically available. As an Easter Egg, the "50th anniversary" train (photo here, but the article is paywalled: https://railcolornews.com/2022/04/26/de-expert-s-bahn-munche...) is highlighted on the map.


Yeah the ridiculous speed confused me for a little bit before I saw the “x50“ up in the corner.

This is really great, and despite saying it’s desktop optimized it worked great on my iPhone.

Love it.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: