Overpass query example

All locations of a chain by Wikidata ID

Find every outlet of an international chain with brand:wikidata. Example: McDonald’s restaurants in Switzerland.

brand:wikidata links a shop or restaurant to the Wikidata item of the brand. It is language-independent and the same in every country, which makes it the most reliable way to find a chain.

The query

[out:json][timeout:60];
area["ISO3166-1"="CH"][admin_level=2]->.ch;
nwr["brand:wikidata"="Q38076"](area.ch);
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. Q38076 is McDonald's on Wikidata. Look up the ID of any brand on wikidata.org.
  2. No amenity filter is needed: the brand tag alone identifies the outlets.

Variations

  • Several brands at once: ["brand:wikidata"~"^(Q38076|Q177054)$"] (McDonald's and Burger King).
  • Big countries take longer to search. Raise [timeout:], or split the query by region.

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 →