Overpass query example

All addresses on a street

List every house number on a street. Example: Bahnhofstrasse, Zürich.

Addresses are tags on buildings, entrances or points: addr:street, addr:housenumber, addr:postcode and addr:city.

The query

[out:json][timeout:25];
area["name"="Zürich"]["admin_level"="8"]->.a;
nwr["addr:street"="Bahnhofstrasse"]["addr:housenumber"](area.a);
out center;

Run it

Running the query…

Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL).

How it works

  1. The area makes the street name unique: almost every Swiss town has a Bahnhofstrasse.
  2. ["addr:housenumber"] ensures each result has a number.

Variations

  • For search-as-you-type geocoding use a geocoder such as Nominatim; Overpass is for bulk lookups.
  • Export the list with CSV output.

Run it from your code

curl https://api.overpass.ch/v1/YOUR_API_KEY/interpreter \
  --data-urlencode 'data@query.overpassql'

Save the query as query.overpassql. It works the same in Overpass Turbo, QGIS and JOSM.

More examples

All examples →