derhuerst / db-rest

A clean REST API wrapping around the Deutsche Bahn API.
https://v6.db.transport.rest/
ISC License
82 stars 10 forks source link

Make rate-limit configurable #28

Closed McToel closed 1 year ago

McToel commented 1 year ago

Hey, I use this rest API in a project of mine. I am using the docker image. In order to support more traffic on my website (https://bahnvorhersage.de), I need to increase the rate limit (or disable it) at some point in time. Is there currently any way to do this? If not, I would like to suggest making it configurable via an environment variable.

Thanks a lot for providing this simple to set up and beautifully working API

derhuerst commented 1 year ago

What does it look like when you're running into the rate limits?

db-rest itself doesn't have a rate limit; The limit stated on https://{v5,v6}.db.transport.rest ("There's a rate limit of 100 requests/minute (burst 150 requests/minute) set up.") is enforced by the reverse proxy, which is not part of db-rest.

The other possible limit you're running into is that the DB HAFAS API rate-limits and/or blocks your server's IP address(es).

derhuerst commented 1 year ago

Please re-open if you want to discuss that the DB HAFAS API rate-limits your API's IP address.