I'm using overpy
to query the Overpass API, and the nature of the data is such that I have a lot of queries to execute. I've run into the 429 OverpassTooManyRequests
exception and I'm trying to play by the rules. I've tried introducing time.sleep
methods to space out the requests, but I have no basis for how long the program should wait before continuing.
I found this link which mentions a "Retry-after" header:
How to avoid HTTP error 429 (Too Many Requests) python
Is there a way to access that header in an overpy
response? I've been through the docs and the source code, but nothing stood out that would allow me to access that header so I can pause querying until it's acceptable to do so again.
I'm using Python 3.6 and overpy 0.4.
OverpassTooManyRequests
exception, wait 10 seconds, then try again? If it's too early, then it'll just wait another 10 seconds. – Girand