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

Good morning. I am a beginner of p.s.m. Firts I tried the following from the browser, and it worked and it still works: https://nominatim.openstreetmap.org/search?street=via+tolmezzo+15&postcode=20132&city=milano&county=MI&country_code=IT&format=json

Then I tried with php, with the following instructions, both from my pc that from a server, but it always return an Error 403. I read that this happens when there is an abuse, but it happened me from the very first submissmion. Thank you.

$data = array( 'street' => "via tolmezzo 15", 'postcode' => "20132", 'city' => "Milano", 'county' => "MI",
'country_code' => "IT", 'format' => "json" ); $options = array ( 'http' => array ( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'GET', 'content' => http_build_query($data) ) ); $url="https://nominatim.openstreetmap.org/search"; $context = stream_context_create ($options); $result = file_get_contents ($url, false, $context);

asked 08 Jan '22, 20:19

enzovisk's gravatar image

enzovisk
11112
accept rate: 0%


You are not following the Nominatim Usage policy, see here: https://operations.osmfoundation.org/policies/nominatim/

You'll have to be esp. careful about including a unique user agent for your application ;)

permanent link

answered 08 Jan '22, 21:00

Spiekerooger's gravatar image

Spiekerooger
3.1k22356
accept rate: 16%

edited 09 Jan '22, 10:12

Thank you for your kind answer. I have read and I followed all these guidelines. It send me such response "error 43" since the first attempt, but all is right.

Afterwards,I tried from different servers and different connections. I also tried with curl. But It always gives me that answer.

Best regards. Vincent

(09 Jan '22, 09:57) enzovisk
1

No, you did not follow the instructions as laid out by the usage policy. I've added another hint in my answer above.

(09 Jan '22, 10:13) Spiekerooger

you should use an UserAgent var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)")

permanent link

answered 18 Jan, 09:17

Nawar327's gravatar image

Nawar327
1
accept rate: 0%

Your answer
toggle preview

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:

×689
×293
×123
×25

question asked: 08 Jan '22, 20:19

question was seen: 2,760 times

last updated: 18 Jan, 09:17

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