Open harbaum opened 2 years ago
There seems to be a new API. A search request for the station name Pionierstraße works like this: https://www.kvv.de/tunnelEfaDirect.php?action=XSLT_STOPFINDER_REQUEST&coordOutputFormat=WGS84[dd.ddddd]&name_sf=pionierstraße&outputFormat=JSON&type_sf=any
Googling for XSLT_STOPFINDER_REQUEST returns links like this one.
oof, that looks like a bigger rewrite is needed :( I'll gladly take contributions since I no longer live in Karlsruhe. Might still have a look at it if I find the time.
There seem to be various endpoints to access KVV information related to this API. Unfortunately some (incl. tunnelfadirect) return HTML even if JSON is requested in some cases. But the aforementioned request for pionierstraße will return stateless "7000238" which in turn can be used like this to get the next ten departures from that station in JSON format:
The URL doesn't sound "stable" and i'd prefer to use something that sounds more promising to last a little longer ...
Also the returned JSON contains all kinds of unwanted stuff which is a burden for my little microcontroller. And finally I haven't figured out yet to specify a certain track in the request so I can e.g. request only inbound trains. I could filter them out later but that won't allow me to predict the number of departures to be displayed.
So I'd like to figure out:
Here's a thread discussing this issue as well: https://verkehrsforum-karlsruhe.de/threads/was-ist-mit-der-kvv-live-api-passiert.280/
Hey everyone, I had some time recently and worked a bit with the API, wrote a quick proof-of-concept in Rust and then went ahead and built a little departure monitor from an esp32. You can see the results and code here, but I too couldn't figure out how to filter the output. With the esp32 it works fine, since it has enough ram for the ~2kb needed per departure entry. If I have more time, maybe I can implement proper Rust bindings for the new API. (I know this is a bit off-topic, but maybe someone will find it helpful :))
It seems the KVV API this project makes use of is gone. But since a similar service still exists there may be a new API ...