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

Hi everyone, I am trying a way to get a valid address or street name using the name city/zipcode. I am trying to use the OneStreetMap API to get this information. To be clear, I will present an example of what I am trying to achieve: Selecting a city from my select box, like Milano, I would like to receive (by API) the list of the addresses or street names that Milano has.

Thank you in advance Achille

asked 29 Apr '23, 13:13

Aki87's gravatar image

Aki87
16112
accept rate: 0%


The Overpass API would be your best bet for this (note usage policy).

An example query giving a csv of all streets and paths in Milano with names (adapted from the documentation):

[out:csv(::id,::type,"highway","name")];
{{geocodeArea:Milano}}->.searchArea;
 ( 
    way["highway"]["name"](area.searchArea);    
  );
out;
out count;

See example live in Overpass Turbo here.

permanent link

answered 30 Apr '23, 17:00

InsertUser's gravatar image

InsertUser
11.0k1369185
accept rate: 19%

Hi, thank you so much to help me. Just another question, I am using the API in this way: https://nominatim.openstreetmap.org/search?X-Requested-With=overpass-ide&format=json&q=Milano.

I am not getting the same result in the example here

Maybe I am not using the API in the correct way. How I can integrate the API in my backend code.

Thank you in advance. Achille

(30 Apr '23, 19:01) Aki87

To be clear, I would like to integrate the API in my app and to show the list of the streen name or addresses.

Is it possible with actual API? I have read the documentation, but maybe I did not catch this case or for me it is little bit difficult to understand.

However, may you help me?

Regards, Achille

(02 May '23, 08:20) Aki87

Technical details aside, I would like to draw your attention to Nominatim Usage Policy.

Conducting bulk geocoding is discouraged, and it is preferable for you to run your own version of Nominatim if you want to implement this in your app.

(02 May '23, 14:55) bxl-forever

@Aki87 The example I gave is for Overpass as you asked about a list of streets, the link you have provided is to Nominatim which is a different service.

  • Overpass API is documented here.
  • Nominatim is documented here.

If what you actually want is a Geocoding service like Nominatim then you can see a list of options here.

(02 May '23, 15:32) InsertUser

how to get the same result by zip code/postal code, instead Milano

For example zip code=80131. Is a Napoli location from Italy

(23 Dec '23, 17:30) salvatore

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:

×362
×290
×202
×142
×107

question asked: 29 Apr '23, 13:13

question was seen: 4,271 times

last updated: 23 Dec '23, 17:30

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