Overpass API User's Manual

Downstream Tools
Spatial Data Selection
Find Objects
Counting Objects
Analysing data
More information

OpenStreetMap and the Overpass API

How does the ecosystem of OpenStreetMap work? Which role does the Overpass API play there?

What is OpenStreetMap?

OpenStreetMap primarily is a database of worldwide geographic data. The data is geographic base data and streets, roads, railways, and waterways should be completely present. Adding shops and restaurants with their names and opening hours is also highly appreciated.

In general, everything that is observable on the ground can be added to OpenStreetMap. A street usually has a name sign, and a restaurant typically annouces its name as well. For a river or a railway line, their names can almost always be read off sign refering to the respective features.

Exceptions to the requirement of being observable exist but are rare. The only universally accepted exceptions are bounadaries of countries, counties, and municipalities.

Personal data is never added to the database. For example, it is forbidden to copy names from bell plates to the database.

Being free from personal data restrictions and license restrictions allows us to make the OpenStreetMap data downloadable in its entirety. It is then possible, in principle, answer questions like

  1. Where is city X, river Y, restaurant Z?
  2. What is situated close to X or inside X?
  3. How do I get as a pedestrian, a cyclist or by using a car from location X to location Y?

Also this data enables us to draw a map of the world in many different ways. To enable assessing the data, in addition to the sample map also a sample tool for geocoding is operated. It is called Nominatim and it answers question (1) from the last paragraph, and it can in addition figure out for a given coordinate the most like postal address. This is called reverse geocoding. Tools to do routing are accomodated on the main site as well. These tools answer the question how to get from location X to location Y.

The database has an already challenging size and every minute more updates and enhancements are performed by the mappers. To download the data en bloc is impractical for that reason. This is mitigated by making available in addition to the complete database every minute a distinct file with the data changes having taken place that very minute.

What is Overpass API?

The Overpass API keeps a copy of the main database up to date with these minute updates and provides them for search. There exist not only public instances to which a request can be send. It is also possible to have your own instance because Overpass API is open source with easy installation and reasonable hardware requirements.

A good starting point is the frontend Overpass Turbo. There, the results of a request appear immediately on a map. As an example we search for everything that has the name Sylt:

nwr[name="Sylt"];
out center;

For this purpose, the text from above is put into the input field on the left hand side, and then the request is sent to Overpass API per click on the Execute button. The query language is versatile but also huge. Thus this whole handbook aims at explaining the query language.

On fact, the Overpass API is designed to answer queries from other software over the internet. It got the name API for that reason. For many popular downstream applications therefore their respective direct connection is explained in the chapter Downstream Tools.


next: The Data Model of OpenStreetMap