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]
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]
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!
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.
And loving the Minimetro vibes! (Running this on android 10 on a OnePlus 7pro - runs smooth in Chrome)