Geolocation¶
Tools for geocoding, reverse geocoding, and querying geographic features using OpenStreetMap data. All tools are free with no API key required.
nominatim_geocode¶
Forward geocode a place name or address to latitude/longitude coordinates using Nominatim (OpenStreetMap).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q |
str | Yes | — | Place name, address, or query (e.g. Berlin, Germany, 1600 Pennsylvania Ave NW). |
limit |
int | No | 5 |
Maximum results to return. |
Returns: JSON array of matching places with coordinates, display name, and OSM metadata.
Auth: None. Rate limit: 1 request/second.
Usage examples
Geocode a city:
Geocode a specific address:
Search for a landmark:
nominatim_reverse¶
Reverse geocode a latitude/longitude coordinate to a place name and address using Nominatim.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
lat |
str | Yes | — | Latitude in decimal degrees (e.g. 52.5200). |
lon |
str | Yes | — | Longitude in decimal degrees (e.g. 13.4050). |
Returns: JSON with the full address, place name, OSM type, and bounding box.
Auth: None. Rate limit: 1 request/second.
Usage examples
Reverse geocode a coordinate:
Look up coordinates from a satellite image:
overpass_query¶
Execute a raw Overpass QL query against the OpenStreetMap Overpass API. Useful for finding infrastructure, facilities, or geographic features within a bounding box.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query |
str | Yes | — | Raw Overpass QL query. Start with [out:json] for JSON output. |
Returns: JSON (or XML) with matching OSM nodes, ways, and relations.
Auth: None. Include [timeout:N] in your query to set a server-side timeout.
Example queries
Find hospitals in a bounding box (Kyiv):
Find all bridges in a region:
Find fuel stations near coordinates: