Hey everyone,
first of all, sorry for the silence from my side over the last few years regarding my open source work in general, as well as this project in particular (see my profile readme for a bit more detail).
I just want to quickly document here why this project is still not working again as of today.
As you might know, bahn.guru used a legacy, semi-public API from DB to fetch its pricing information. Early last year, DB disabled this old API as part of its shift to the new bahn.de / DB Navigator App frontends, which use a different API now. This resulted in bahn.guru not being able to fetch price data anymore.
This is not the first time bahn.guru had to be adapted to an upstream API change, however this API change was different. Besides being a complete overhaul of the API rather than a few changed fields (which would have been an effort to adapt to, but still manageable), the new API is also way more strict in enforcing request limits and blocking client IP addresses after a certain amount of requests.
The latter made it basically impossible to adapt our existing technical setup with a centralized server to the new API, as it would always be blocked after a few hours. As far as I can tell, the only realistic workaround for this issue (besides annoying and probably semi-legal solutions like constantly shuffling IP addresses to circumvent the blocker) would probably be to have the clients make all requests themselves.
However, with the API's CORS setup, this would not be possible in a normal website.
TL;DR - As far as I can tell, with the currently available API, the only realistic way to get bahn.guru working again would be either to create a custom browser addon for users to install which changes CORS behaviour (IMO ugly and unrealistic for people to adopt), or to create a native app (less ugly, but a lot more effort). Both these "solutions" seemed more complex than what I was willing and/or able to create.
What does that mean for the future? Does that mean the end of bahn.guru? My personal assessment is that there will probably be some EU regulation forcing train operators to publish their pricing information at some point in the future. At that point, a service like bahn.guru can come back, without weird workarounds.
Until then, I will archive this repo, but I'll un-archive it again in case something changes regarding availability of DB data. Also, quick reminder: This project is ISC licensed, bahn.guru is not a licensed trademark, and the idea of having a price calendar for trains is anyone's to claim. So if you have the energy to build something that works despite what I claimed above, please do so, I'd appreciate it 😄
Best,
Julius
Hey everyone,
first of all, sorry for the silence from my side over the last few years regarding my open source work in general, as well as this project in particular (see my profile readme for a bit more detail).
I just want to quickly document here why this project is still not working again as of today.
As you might know, bahn.guru used a legacy, semi-public API from DB to fetch its pricing information. Early last year, DB disabled this old API as part of its shift to the new bahn.de / DB Navigator App frontends, which use a different API now. This resulted in bahn.guru not being able to fetch price data anymore.
This is not the first time bahn.guru had to be adapted to an upstream API change, however this API change was different. Besides being a complete overhaul of the API rather than a few changed fields (which would have been an effort to adapt to, but still manageable), the new API is also way more strict in enforcing request limits and blocking client IP addresses after a certain amount of requests.
The latter made it basically impossible to adapt our existing technical setup with a centralized server to the new API, as it would always be blocked after a few hours. As far as I can tell, the only realistic workaround for this issue (besides annoying and probably semi-legal solutions like constantly shuffling IP addresses to circumvent the blocker) would probably be to have the clients make all requests themselves.
However, with the API's CORS setup, this would not be possible in a normal website.
TL;DR - As far as I can tell, with the currently available API, the only realistic way to get bahn.guru working again would be either to create a custom browser addon for users to install which changes CORS behaviour (IMO ugly and unrealistic for people to adopt), or to create a native app (less ugly, but a lot more effort). Both these "solutions" seemed more complex than what I was willing and/or able to create.
What does that mean for the future? Does that mean the end of bahn.guru? My personal assessment is that there will probably be some EU regulation forcing train operators to publish their pricing information at some point in the future. At that point, a service like bahn.guru can come back, without weird workarounds.
Until then, I will archive this repo, but I'll un-archive it again in case something changes regarding availability of DB data. Also, quick reminder: This project is ISC licensed, bahn.guru is not a licensed trademark, and the idea of having a price calendar for trains is anyone's to claim. So if you have the energy to build something that works despite what I claimed above, please do so, I'd appreciate it 😄
Best,
Julius