Microproduct data guideintermediate

OpenStreetMap Overpass API

Live OpenStreetMap features for building bounded place, amenity, and infrastructure lookup tools without downloading the planet.

At a glance

Difficulty
Intermediate — some data preparation helps
Size
Tiny · ≤0.05 GB
Formats
JSON, XML
Access
API
API key
Not required
Provider
OpenStreetMap contributors
Updates
Continuous

From source to product signal

Test a product idea in four steps

Overpass returns live OSM features for a bounding box or named area. Start with one city bbox and a LIMIT, not a planet dump. Send a descriptive User-Agent. Results are volunteer-mapped, ODbL share-alike applies to derivative databases, and coverage varies by city.

1

Check the setup

  • Python 3.10 or newer
  • A notebook environment such as Jupyter or Google Colab
  • An internet connection
2

Access the data

  1. 1.Read the Overpass API wiki and the OpenStreetMap copyright page.
  2. 2.Write a QL query with a bounding box and a max number of features.
  3. 3.POST or GET the query with a descriptive User-Agent.
Open official source
3

Run the Python example

Install the packages, then run the notebook cell.

python -m pip install pandas requests

import pandas as pd
import requests

query = """
[out:json][timeout:25];
node["amenity"="cafe"](40.74,-74.02,40.76,-73.99);
out 20;
"""
response = requests.get(
    "https://overpass-api.de/api/interpreter",
    params={"data": query},
    headers={
        "User-Agent": (
            "TrilemmaDataCatalogExample/1.0 "
            "(https://data.trilemma.foundation)"
        )
    },
    timeout=30,
)
response.raise_for_status()
cafes = pd.json_normalize(response.json()["elements"])
print(cafes.filter(regex="id|lat|lon|tags.name").head())
4

Test a useful signal

List cafes inside a Manhattan bounding box

Test whether a bounded Overpass query can power a neighborhood amenity list.

  1. 01Keep OSM id, coordinates, and name for up to 20 cafes.
  2. 02Count unnamed nodes instead of filling names from other maps.
  3. 03Attribute OpenStreetMap contributors under ODbL and do not publish a planet extract from this guide.

Dataset details

OpenStreetMap contributors is a community source. Last verified 2026-08-18. Temporal coverage: continuously updated OpenStreetMap features.

Theme

Geospatial & Infrastructure

Domains

MappingInfrastructurePlaces

Data types

GeospatialOpenStreetMap Features

Tasks

Geographic AnalysisPlace LookupInfrastructure Mapping

Geography

Global

Formats

JSONXML

Provider

OpenStreetMap contributors

Data terms

Open Database License