I'm trying to fetch a tile https://b.tile.openstreetmap.org/16/35672/23381.png from a Go script, and the server is returning a 403/Forbidden error. Go is using HTTP/2 by default (instead of more common HTTP/1.1) so it might be a configuration error? Other headers indicate the error was generated by the Squid proxy. Who can I talk to to resolve this? asked 27 Dec '19, 01:52 ivoras |
It was about the user-agent: the tile servers require non-browsers to have user-agent strings which identify applications, to be able to enforce tile download policy. If someone encounters this problem in the future: you need to set the User-Agent HTTP header to identify your application. More information is available at the Tile usage policy page. answered 27 Dec '19, 23:11 ivoras |
You are probably hitting one of the limit explained here : https://operations.osmfoundation.org/policies/tiles/ In particular, using a script to access tiles is most probably beyond acceptable usage. answered 27 Dec '19, 07:21 yvecai Nope, never tried it before, I just wrote the script. Additionally, loading the tile from a web browser works, both with HTTPS and HTTP, but loading it with the script doesn't - maybe there's a blanket ban for Go's user-agent?
(27 Dec '19, 11:26)
ivoras
1
Please don't respond to answers with further answers, add a comment or amend your original question. In general generic user agents will sooner or later be blocked, adhere to the tou and you should be fine.
(27 Dec '19, 15:58)
SimonPoole ♦
|