So I have this code that runs through a loop for municipality codes for Denmark, there are about 98 municipalities, using Python. I take all the nodes, ways and relations that match some amenities I want (pub|bar|cafe|restaurant| etc.) and put them into a list. It is very important that I have the municipality code for each amenity, and this is the only way I found out to make it work. So I am doing 98 requests, I have had a sleep timer of 6 seconds, but now lately I am getting blocked even after just one request, even if I have a sleep timer of 10 seconds. Is there a way to rewrite this code so that I can do this in only one request perhaps, so that I dont get the 429 error? I send each request with my contact details (the mail was wrong I saw, but fixed now). I have done a lot of requests earlier when testing the code, but then I have done it only for one municipality, checking if I am getting the result I want, and then retesting, but always a limited amount of requests.
|
Did you think about downloading whole Denmark and performing your queries offline? E.g. by using osmium-tool, there are also python bindings available!