Overpass API/Python API
Jump to navigation
Jump to search
Overpass Python API | |
---|---|
Author: | Martijn van Exel |
License: | Apache 2.0 (free of charge) |
Platform: | Python |
Version: | 0.7.2 (2024-08-10) |
Language: | English |
Source code: | https://github.com/mvexel/overpass-api-python-wrapper |
Programming language: | Python |
Python 3.9+ API for Overpass |
A simple but powerful Python interface to the Overpass API.
Examples
Searching for all nodes named “Salt Lake City”
>>> import overpass
>>> api = overpass.API()
>>> response = api.get('node["name"="Salt Lake City"]')
>>> print [(
... feature['properties']['name'],
... feature['id']) for feature in response["features"]]
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637)]
This would output two nodes:
- 150935219, representing the label for the place=city relation named Salt Lake City
- 585370637, a now-deleted node representing a landuse=quarry named Salt Lake City
Other examples
You can find more examples and documentation on GitHub (see box)