Overpass query example

All cafés in a city

List every café in a city, as points or buildings. Example: Lisbon.

Cafés are one of the most common things people look up. This query returns every café within the municipality of Lisbon, whether it is mapped as a point or as a building.

The query

[out:json][timeout:60];
area["name"="Lisboa"]["admin_level"="7"]->.a;
nwr["amenity"="cafe"](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. In Portugal, municipalities have admin_level 7. With level 8 (a parish) the query would find nothing.
  2. nwr with out center; returns one coordinate per café.

Variations

  • Add ["outdoor_seating"="yes"] for terraces, or ["internet_access"="wlan"] for Wi-Fi.
  • Need a spreadsheet? Switch to 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 →