canonical: https://jentic.com/apis/overpass-api.de/overpass-api

# Overpass Api De Overpass API

The Overpass API is a read-only API serving custom-selected parts of OpenStreetMap (OSM) data. It acts as a database-over-the-web where clients send queries in the Overpass QL query language and receive filtered map data in return. Optimized for data consumers needing a few elements instantly or up to roughly 10 million elements in minutes, it supports queries for nodes, ways, relations, tags, and geographic bounding boxes. Use it to extract POI data, analyze road networks, retrieve building footprints, power location-based apps, or build custom map visualizations from OSM.

## For AI agents

Query OpenStreetMap data with Overpass QL for POIs, roads, buildings, and geospatial analysis workflows.

## Scope

Read-only API for querying OSM data - does not edit map data, handle user accounts, or provide routing/geocoding services directly.

## Capabilities

- Execute Overpass QL queries to retrieve filtered OpenStreetMap data
- Query nodes, ways, relations, and tags from OSM
- Filter by geographic bounding boxes, areas, or specific coordinates
- Retrieve POIs like restaurants, shops, amenities by tag filters
- Extract road networks, highways, and transportation infrastructure
- Query building footprints and land use polygons
- Check API status and server load
- Retrieve OSM data timestamps for cache validation
- Kill long-running queries to free server resources

## Use cases

### POI Data Extraction for Location Apps

Extract points of interest from OpenStreetMap for location-based apps, travel guides, or business directories. POST `/api/interpreter` with an Overpass QL query like `node['amenity'='restaurant'](around:5000,lat,lon)` retrieves all restaurants within 5km of a coordinate. Filter by tags (cuisine, rating, opening hours) and export to JSON or XML. This powers map overlays, search features, and recommendation engines without maintaining a full OSM database.

Example prompt: POST `/api/interpreter` with Overpass QL query filtering by amenity tag and bounding box. Parse response for name, coordinates, and tags to populate location database.

### Road Network and Routing Analysis

Retrieve road network data for transportation planning, routing algorithms, or traffic analysis. Query highways, streets, and paths with Overpass QL, filtering by road type (primary, secondary, residential), surface, or access restrictions. Export ways with geometry and tags to build custom routing graphs, analyze network connectivity, or identify gaps in infrastructure. This supports logistics optimization, urban planning, and delivery route calculation.

Example prompt: POST `/api/interpreter` with Overpass QL query for `way['highway'](bbox)` to retrieve roads in a region. Export geometry and tags for routing engine ingestion.

### Building Footprint and Land Use Mapping

Extract building polygons and land use data for GIS analysis, urban planning, or real estate applications. Query buildings by type (residential, commercial, industrial) or retrieve land use polygons (parks, forests, water bodies). Combine with other geospatial datasets to analyze density, zoning, or environmental impact. This powers property mapping tools, urban growth studies, and environmental monitoring dashboards.

Example prompt: POST `/api/interpreter` with Overpass QL query for `way['building'](bbox)` to retrieve building footprints. Export polygons as GeoJSON for GIS software or web maps.

### Geospatial Data for Machine Learning

Build training datasets for machine learning models using OSM data retrieved via Overpass API. Extract labeled features like roads, buildings, landcover, and POIs to train computer vision models, route prediction algorithms, or location classifiers. The API's tag-based filtering allows precise dataset construction - retrieve only schools, hospitals, or specific building types for targeted model training.

Example prompt: POST `/api/interpreter` with Overpass QL queries for multiple feature types (buildings, roads, landcover), export as GeoJSON, then label and preprocess for ML training pipelines.

### AI Agent for Geospatial Queries

Let an AI agent handle Overpass API queries for geospatial data extraction. Through Jentic, the agent searches by intent ('find all restaurants in a city from OpenStreetMap') and generates the appropriate Overpass QL query. The API requires no authentication, simplifying integration.

Example prompt: Use the Jentic search query 'find restaurants in OpenStreetMap' to identify POST `/api/interpreter`, generate an Overpass QL query with filters, and execute to retrieve POI data.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/interpreter` | Execute Overpass QL query and retrieve OSM data |
| GET | `/api/status` | Check API server status and load |
| GET | `/api/timestamp` | Retrieve OSM data timestamp |
| POST | `/api/kill_my_queries` | Cancel running queries for the client |

## Key resources

- **Nodes** — Point features in OSM (POIs, coordinates)
- **Ways** — Linear features (roads, rivers) and closed polygons (buildings, parks)
- **Relations** — Logical groupings of nodes and ways (administrative boundaries, multipolygons)
- **Tags** — Key-value metadata describing features (amenity=restaurant, highway=primary)
- **Bounding Boxes** — Geographic areas defined by min/max latitude and longitude

## Why Jentic

- **Setup:** Wiring Overpass by hand means picking a mirror host, POSTing hand-built Overpass QL to `/api/interpreter`, and watching the status endpoint to respect rate slots. Through Jentic you install once, import the Overpass API from the API Directory, and your agent calls it, with no key to store because the API needs no authentication.
- **Permission scoping:** Overpass needs no credentials and its query travels in the request body rather than the URL path, so scope the agent to the operations it needs, such as running an interpreter query or checking status. Because you choose the allowed operations, the maintenance call to kill running queries is not included unless you add it.
- **Credential handling:** Overpass requires no authentication, so there is no credential to store, and nothing sensitive enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'find restaurants in OpenStreetMap' or 'extract a road network from OSM', and Jentic returns the `/api/interpreter` operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenStreetMap API** — The main OSM API handles read/write operations; Overpass API is optimized for complex read queries.
- **Google Places API** — Google Places provides commercial POI data; Overpass API queries open-source OSM data.

## FAQ

### What authentication does the Overpass API use?

The Overpass API requires no authentication. It is a public, read-only API for querying OpenStreetMap data. Through Jentic, queries are executed directly without credential management.

### What is Overpass QL?

Overpass QL is the query language for the Overpass API. It allows filtering OSM data by tags, geographic areas, and relationships. Example: `node['amenity'='restaurant'](bbox)` finds all restaurants in a bounding box.

### Can I retrieve data for an entire country?

Yes, but large queries (10M+ elements) may take minutes and strain server resources. For bulk downloads, consider using OSM planet files or regional extracts instead of the Overpass API.

### Is the Overpass API free?

Yes. The Overpass API is a free, community-supported service. However, users should respect server load limits and avoid abusive query patterns.

### How do I cancel a long-running query?

POST `/api/kill_my_queries` terminates all queries initiated by your client, freeing server resources.

### What output formats does the API support?

The API returns data in OSM XML, JSON, or CSV formats depending on the output clause in the Overpass QL query. GeoJSON export is also supported.

### Can I limit what my agent is allowed to do with the Overpass API?

Yes. Because Jentic One is self-hosted, you decide which Overpass operations your agent can call, and your own rules are what grant or deny each one. You can allow only a read query against `/api/interpreter` and a health check on `/api/status`, and leave out the maintenance call to `/api/kill_my_queries` unless you choose to add it. The Overpass API needs no credentials, so there is no key to store, and the agent can reach only the operations you have permitted.
