I want to build an LED map that shows every train currently in a Berlin S-Bahn or U-Bahn station. My idea is to light up the LED corresponding to each station whenever a train is present.
Currently, I’m using https://v6.vbb.transport.rest/ to get the data, but this API only supports requesting one station at a time. With 381 stations, I’d need to poll each individually, which exceeds the API rate limit and is inefficient.
Currently, I have:
- A Node.js server that requests train data.
- An ESP32 microcontroller that fetches the LED color/number from the server to drive addressable RGB LEDs.
APIs to use
I’m not sure if there’s a way to query all stations at once or get train positions in bulk. The current approach (looping through each station with /stops/:id/departures) is slow and API‑intensive.
My question
Is there any way to do this more efficiently than making 381 individual station requests? Could I use a different endpoint, like one that returns all train positions or all departures in one call?
I want to build an LED map that shows every train currently in a Berlin S-Bahn or U-Bahn station. My idea is to light up the LED corresponding to each station whenever a train is present.
Currently, I’m using https://v6.vbb.transport.rest/ to get the data, but this API only supports requesting one station at a time. With 381 stations, I’d need to poll each individually, which exceeds the API rate limit and is inefficient.
Currently, I have:
APIs to use
I’m not sure if there’s a way to query all stations at once or get train positions in bulk. The current approach (looping through each station with /stops/:id/departures) is slow and API‑intensive.
My question
Is there any way to do this more efficiently than making 381 individual station requests? Could I use a different endpoint, like one that returns all train positions or all departures in one call?