Home / GIS and Open Map Data for Beginners

Overpass Turbo: Query OpenStreetMap Like a Database, From Wizard to Export

Multicolored code text on a computer screen

Photo: Markus Spiske / Pexels

OpenStreetMap's website answers "where is this place?" Overpass Turbo answers the better question: "show me all of them." All the pharmacies in a city, all the campsites in a national park, all the roads with a given surface in a county. It is a free web tool at overpass-turbo.eu that queries the live OSM database through the Overpass API, draws the results on a map, and exports them as real data. Our broader guide to using the OpenStreetMap API covers the API family as a whole; this article owns the Overpass Turbo workflow specifically, from a plain English wish to a file on your disk.

Interactive tool

Your First Overpass Query: Wizard to Export

Check off each step as you finish it. Your progress stays on this page.

0 of 6 complete

0% done

The Wizard: Plain Words In, Query Language Out

You do not start by writing code. Click Wizard and type a plain term: bench, drinking_water, bakery, or a tag pair like tourism=camp_site. The Wizard generates an Overpass QL query for everything in the current map view matching that term, and runs it. For the majority of real questions ("where are the X near here?"), the Wizard's output is the finished product, and everything else in this article is refinement.

Two habits make Wizard results trustworthy. First, set the map view before you run: the default generated query searches the visible map area, so zoom and pan to your territory first, or you will query a continent when you wanted a town. Second, read the generated query once, even if you never write one from scratch. It is short, and the next section decodes it, because the day the Wizard's guess is wrong, you will fix the query by hand.

Anatomy of a Query

A typical Wizard query looks like this:

```

[out:json][timeout:25];

(

node"amenity"="bench";

way"amenity"="bench";

relation"amenity"="bench";

);

out body;

;

out skel qt;

```

Piece by piece:

  • [out:json][timeout:25]; is the header: return JSON, and give the server 25 seconds before timing out. Big areas need bigger timeouts; small ones should keep this modest out of courtesy to a shared, free service.
  • node / way / relation are OSM's three element types. A bench is usually a node (a point). A building or a road is a way (a line or outline). A bus route or a national park boundary is a relation (a grouping). Querying all three, as the Wizard does, means not caring which type holds your feature.
  • ["amenity"="bench"] is the tag filter: key equals value, the same tagging you see in the OSM editor. Change the value to change the question; add a second filter in another bracket to narrow it, like ["amenity"="cafe"]["outdoor_seating"="yes"].
  • ({{bbox}}) restricts the search to the current map bounding box. This is the single most important performance habit: an unbounded query for a common feature asks the server for the planet, and the server will refuse or time out.
  • out body; >; out skel qt; controls the output: the matched elements with their tags, plus the geometry needed to draw them.

Beyond the Box: Area Filters and Around

The bounding box is a rectangle, and the world is not. Two refinements cover most real territory questions:

  • Area search. Replace the box with a named place: define an area from a place name or boundary relation (the Wizard can generate this from a term like bakery in Lisbon), and the query searches inside the real boundary, river bends and all. Administrative boundaries, park boundaries, and postal areas all work this way.
  • Around. The around filter finds elements within a distance of a point or a line: drinking water within 500 meters of a trail, parking within 200 meters of a venue. Chained with a first query for the trail itself, it becomes "facilities along my route," the question hikers and cyclists actually ask.

Both refinements reward small scopes. A county sized area query for a common feature can return tens of thousands of elements and a slow, heavy response; a town sized one returns in seconds. Shrink the territory before you enlarge the timeout.

Colorful programming code displayed on a monitor screen
Colorful programming code displayed on a monitor screen

Reading Results and Exporting

Results land on the map as highlighted points, lines, and areas, and clicking one shows its full tag set, which is often the real answer: opening hours, surfaces, access rules, the works. The Export menu is where the tool pays off beyond curiosity:

  • GeoJSON or GPX for loading into a GIS, a mapping app, or a GPS device.
  • KML for Google Earth.
  • Raw data and the query itself, for reproducibility: save the query text with the export, so future you can rerun the identical question next season and diff the answers.

A saved query is a reusable instrument. The bench survey, the water points along a long trail, the charging stations in a new city: each becomes a bookmark that answers fresh every time it runs, because the underlying database improves daily. That is the habit that separates Overpass Turbo as a toy from Overpass Turbo as a tool.

Three Queries Worth Saving

Abstract syntax becomes obvious the moment it answers a real question. These three patterns cover most of what people actually ask, and each is a small edit of a Wizard query.

Drinking water near a trail. First get the trail as a relation or way from its name, then ask for water points around it: the pattern is a query for the route, followed by node"amenity"="drinking_water" against the route's geometry. Five hundred meters is the honest radius: water further than that from the path is a detour, not a refill. Hikers run this before any long dry section, and the export goes straight into the navigation app as waypoints.

Every bench in a park. Benches are nodes with amenity=bench, and the park is an area, so the query is the Wizard's "bench in" form against the park's boundary. Parks departments, friends groups, and accessibility auditors run exactly this to count, map, and plan maintenance. Adding a second filter, for benches with a backrest (backrest=yes), shows how quickly a census becomes a survey.

Charging stations in a new city. amenity=charging_station inside the city area returns the network as OSM knows it, and clicking results reveals the tags that decide usefulness: socket types, capacity, operator, access restrictions. Exported as GeoJSON, it drops into the same GIS where the rest of a trip or a fleet plan lives.

Read the three again and the pattern generalizes: a feature tag, a territory (box, area, or around), and an export. Every Overpass question you will ever ask is those three choices in some order, which is why ten minutes with the Wizard teaches the tool better than an hour of documentation.

Courtesy and Limits of a Free Engine

The Overpass API is a shared public resource run for the community, and Overpass Turbo's defaults are set to keep you polite: bounded areas, sane timeouts, one query at a time. Queries that ask for common features over huge areas will time out, and that timeout is the system protecting itself, not a bug to defeat with retries. If your question is genuinely continental, the right tool is a downloaded OSM extract processed locally, not a bigger hammer on the shared server. Within town and county scales, which is where nearly every real question lives, the service is fast, free, and remarkably deep. If you then want to fix what your query reveals is missing, that is editing, and our guide to adding a place to OpenStreetMap is the on ramp.

Tactics for Queries That Time Out

When a query fails by size rather than by syntax, the fix is strategy, not grammar. Shrink the territory before you shrink the question: a county sized answer is usually four town sized queries wearing a trench coat, and four small queries finish faster and fail softer than one giant one. Filter harder upstream: asking for one amenity is cheap, asking for everything and filtering in your head is how timeouts are born; every tag you add to the query is work the server does once instead of work your browser does forever. Ask for less geometry: if you need counts or points, nodes only queries are dramatically lighter than ways with full geometry, and center output (out center) gives you one point per way or relation instead of every vertex. Use the other instances: Overpass runs on more than one public server, and Overpass Turbo's settings let you point at an alternative instance when the default is loaded; a query that times out at peak hour on one host often sails through on another. And when the question is genuinely national in scale, accept the honest answer the timeout is giving you: that is a planet extract job, the other download path named earlier, and no amount of query craft turns a shared API into a bulk mirror.

The Habit That Makes It Yours

Tools become skills through saved work. Keep a small document of your own: every query that answered a real question, pasted with a one line note about what it found and the territory it ran on. Within a month you will own a personal library covering your recurring questions, your town, your sports, your work, and editing a saved query for a new town or a new feature is faster than any wizard. The library is also a diary of what the map knows about the places you care about, and running the same query a year later and diffing the results is the simplest change detection a citizen can perform: new chargers, vanished benches, a park that gained its water fountain. Overpass answers questions. A saved habit of asking them turns those answers into knowledge.

Related Guides

If this page answered part of the question, these GIS and open map data guides cover the rest of the same ground:

Frequently Asked Questions

What is Overpass Turbo used for?

It queries the OpenStreetMap database and shows every element matching your conditions in an area: all benches, water points, campsites, or any other tagged feature. Results appear on a map with their full tags and can be exported as GeoJSON, GPX, KML, or raw data for use in other tools.

Do I need to learn Overpass QL to use it?

No. The Wizard converts plain terms like bench or tourism=camp_site into a working query for the current map view. Learning to read the generated query is worthwhile because it lets you adjust tag filters, widen a timeout, or change the search area, but writing queries from scratch is optional for most questions.

Why does my query time out?

Almost always scope. An unbounded or continent sized query for a common feature asks the server for more than it will give. Zoom the map to your real area so the {{bbox}} filter is small, keep the timeout reasonable, and narrow the tags. If the question truly is huge, use a downloaded OSM extract locally instead of the shared API.

What is the difference between node, way, and relation in a query?

They are OpenStreetMap's three element types: nodes are points, ways are lines and outlines such as roads and buildings, and relations group elements into things like routes and boundaries. The Wizard queries all three so your feature is found whichever type represents it. Restricting to one type is a useful refinement when you know, for example, that you only want building outlines.

Can I search within a city boundary instead of a rectangle?

Yes. Use an area filter: the Wizard can build queries of the form "feature in PlaceName", which resolves the place's boundary relation and searches inside the true boundary rather than a bounding box. It works for administrative areas, parks, and other bounded territories in OSM.

Photo credits: Markus Spiske (Pexels); Myburgh Roux (Pexels). Photos are served from this site; follow the credit to the library page for the original.