You are not logged in.

#1 2020-01-15 13:32:21

Gerald1904
Member
Registered: 2020-01-15
Posts: 4

Error: (429) Too Many Requests.

I wrote a GIS, based on dotspatial and fetching OSM tiles (via C#-WebClient). Everything worked fine in May last year.
Now I get an error when trying to download tiles from OSM server. I use e. g. the command "http://tile.openstreetmap.org/11/1076/659.png".
Using a browser I receive the desired tile. But using my desktop GIS, I receive the error message: "Error: (429) Too Many Requests."
What can I do?

Offline

#2 2020-01-15 13:45:59

SimonPoole
Member
Registered: 2010-03-14
Posts: 1,925

Re: Error: (429) Too Many Requests.

You are nearly guaranteed to be violating the ToU (enforcement of which is now slightly stricter than it used to be), see:

https://operations.osmfoundation.org/policies/

Offline

#3 2020-01-15 15:21:08

Gerald1904
Member
Registered: 2020-01-15
Posts: 4

Re: Error: (429) Too Many Requests.

How can I generate a valid HTTP User-Agent?
What is a valid HTTP Referer?

Offline

#4 2020-01-31 22:14:56

AndrewUrquhart
Member
Registered: 2020-01-31
Posts: 1

Re: Error: (429) Too Many Requests.

I had the same problem with a python app. Fixed it now as follows:

from urllib3 import PoolManager
user_agent = {'user-agent': 'My program name and version number contact myname@myuni.ac.uk'}
http = PoolManager(headers=user_agent)
url = 'https://a.tile.openstreetmap.org/15/16311/10815.png'
response = http.request('GET', url)

Good practice apparently is to put a proper email address in the text, but otherwise free format.

Offline

#5 2020-02-03 11:44:18

syder_
Member
Registered: 2020-02-03
Posts: 1

Re: Error: (429) Too Many Requests.

Hi !

I got that problem to build a png image from PHP 5.6. Function getimagesize and imagecreatefrompng return Error: (429) Too Many Requests from december 2019.

To solve this (thanx to previous answer), I just modifi user_agent property in php.ini defaul is 'PHP', I think that OSM drop connection with this user_agent.
I put 
user_agent = '[My program name] [version number] contact [contact@adress.com]'

With this header OSM accept the connection and my php script work.

Thanx.

En français :
J'ai rencontré ce problème pour construire une image PNG a partir d'OSM en PHP 5.6. Les fonction getimagesize et imagecreatefrompng me retournaient une erreur  (429) Too Many Requests depuis décembre 2019 et la migration des serveurs OSM.

Pour résoudre ce problème (merci à la réponse précédente) j'ai modifié la propriété user_agent='PHP' dans php.ini. Je pense que par défaut les user_agent 'PHP' sont dropé car tout les script 'PHP' ont cet user_agent et OSM pense qu'il y a trop de connexion dessus.

J'ai mis user_agent = '[My program name] [version number] contact [contact@adress.com]'

Avec ce header OSM accept mes connection et mon script fonctionne.

Merci.

Offline

#6 2020-02-05 19:22:39

Gerem
New Member
Registered: 2020-02-05
Posts: 1

Re: Error: (429) Too Many Requests.

Hello,

I get the same problem which stat today on my website…
I am using javascript to load the tile.
And I get an error 429, with no tile load.

How can i fix this ?

Offline

#7 2020-02-06 12:14:51

Gerald1904
Member
Registered: 2020-01-15
Posts: 4

Re: Error: (429) Too Many Requests.

Thanks for the helpfull answers. With such an user agent string, consisting of company, version and e-mail address, I get tiles now. For about three or four screens (with appr. 80-100 tiles) it works in an acceptable speed. But after this, it goes slower and slower ...

Offline

#8 2020-02-18 14:01:16

Fabio Mosti
Member
Registered: 2019-08-30
Posts: 7

Re: Error: (429) Too Many Requests.

please help,
I tried to put a valid user agent in my PHP Curl request but still my tile proxy can't get the tiles... I really would like to not overload OSM servers with requests, but if my proxy doesn't work I have to call them directly

I use a modified version of this proxy: https://wiki.openstreetmap.org/wiki/ProxySimplePHP

any help would be appreciated

Offline

#9 2020-03-05 08:55:26

ArminMueller
New Member
Registered: 2020-03-05
Posts: 1

Re: Error: (429) Too Many Requests.

@Fabio i have the same problem. Do you have a solution in the meantime?

Offline

Board footer

Powered by FluxBB