OpenStreetMap Geocoding
Type any address or place name and get its latitude & longitude from OpenStreetMap data — instantly, free, and shown on a map. Need it in code? Use the geocoding API below.
🔎 Geocode an address
Get coordinates from an address with OpenStreetMap
Geocoding (also called forward geocoding) turns a place name or street address into a latitude and longitude. This tool uses OpenStreetMap data — the world's largest open mapping database — so you get global coverage with no Google dependency and no vendor lock-in.
Try it above: type something like Brandenburg Gate, Berlin, press Get Coordinates, and the best OpenStreetMap matches appear with their coordinates. Click any result to see it on the map.
OpenStreetMap geocoding API
Everything the tool does is one HTTPS request. The endpoint takes a query string q and returns GeoJSON:
# curl — address → coordinates
curl "https://api.latlng.work/api?q=Brandenburg+Gate,+Berlin" \
-H "X-Api-Key: YOUR_API_KEY"
// JavaScript (fetch)
const res = await fetch(
"https://api.latlng.work/api?q=" + encodeURIComponent("Brandenburg Gate, Berlin")
);
const { features } = await res.json();
const [lon, lat] = features[0].geometry.coordinates;
console.log(lat, lon);
# Python (requests)
import requests
r = requests.get("https://api.latlng.work/api",
params={"q": "Brandenburg Gate, Berlin"})
lon, lat = r.json()["features"][0]["geometry"]["coordinates"]
print(lat, lon)
Response fields
Each match is a GeoJSON feature. geometry.coordinates is [longitude, latitude]; properties may include:
- name — place or building name
- housenumber & street
- city, county, state, postcode
- country & countrycode
- type — OSM place classification, plus extent (bounding box) for larger places
LatLng vs. Nominatim for OpenStreetMap geocoding
Nominatim is the official OpenStreetMap geocoder, but its free public server has a strict usage policy that rules out production use. LatLng serves the same OpenStreetMap data without those limits:
| Public Nominatim | LatLng OSM API | |
|---|---|---|
| Rate limit | 1 request / second | No 1 req/s throttle |
| Bulk / heavy use | Not allowed | Allowed on paid plans |
| Data source | OpenStreetMap | OpenStreetMap |
| Response format | Custom JSON | GeoJSON (RFC 7946) |
If Nominatim's rate limit is blocking you, this is a drop-in hosted alternative — same open data, faster, with an API key.
Frequently asked questions
How do I geocode an address with OpenStreetMap?
Type a place name or address into the tool above (e.g. Brandenburg Gate, Berlin) and it returns the matching latitude/longitude from OpenStreetMap data, shown on a map. In code, call https://api.latlng.work/api?q=YOUR+QUERY.
Is OpenStreetMap geocoding free?
Yes. The tool on this page is free with no sign-up. The API includes a free daily allowance; higher volumes are available on paid plans. All results come from open OpenStreetMap data.
How do I get coordinates from an address in OpenStreetMap?
Forward geocoding is a single HTTPS request: GET https://api.latlng.work/api?q=1600+Pennsylvania+Ave. The response is GeoJSON whose geometry.coordinates array holds [longitude, latitude].
What is the difference between this and Nominatim?
Nominatim is the official OpenStreetMap geocoder, but its public server allows only 1 request per second and no bulk use. LatLng serves the same OpenStreetMap data from a fast hosted API with higher limits and an API key, so you can use it in production.
Can I geocode addresses in Python or JavaScript?
Yes — because it is a plain HTTPS GET, it works from any language. Samples for curl, JavaScript (fetch) and Python (requests) are shown below.
Does it return multiple matches?
Yes. Ambiguous queries return several ranked candidates, each with its own coordinates and address components, so you can pick the right one. Use the limit parameter to control how many.