NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

ivoras
41114
accept rate: 0%

edited 27 Dec '19, 01:53


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.

permanent link

answered 27 Dec '19, 23:11

ivoras's gravatar image

ivoras
41114
accept rate: 0%

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.

permanent link

answered 27 Dec '19, 07:21

yvecai's gravatar image

yvecai
1.5k1226
accept rate: 9%

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 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×287
×204

question asked: 27 Dec '19, 01:52

question was seen: 11,332 times

last updated: 27 Dec '19, 23:11

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum