TL;DR
Nominatim (from Latin "by name") is the official geocoding service for OpenStreetMap data. It converts free-text location queries into precise GPS coordinates (forward geocoding) and reverse-geocodes coordinates back into structured addresses. It covers the entire planet using OSM's community-maintained map data. The API requires a User-Agent header identifying your application and enforces a strict 1 request per second rate limit.
Quick start: https://nominatim.openstreetmap.org/search?q=New+York&format=json
No API key needed — just make a request!
How to Use This API
1. Forward Geocoding — Address to Coordinates
https://nominatim.openstreetmap.org/search?q=New+York&format=json
2. Reverse Geocoding — Coordinates to Address
https://nominatim.openstreetmap.org/reverse?lat=40.748817&lon=-73.985428&format=json
3. Structured Query
https://nominatim.openstreetmap.org/search?city=Tokyo&country=Japan&format=json
4. JavaScript — Geocode Search
fetch('https://nominatim.openstreetmap.org/search?q=Paris&format=json&limit=3', {
headers: {'User-Agent': 'MyApp/1.0'}
})
.then(r => r.json())
.then(results => {
results.forEach(p => {
console.log(p.display_name, '—', p.lat, p.lon);
});
});
5. Python — Lookup Address
import requests
headers = {'User-Agent': 'MyGeocoder/1.0'}
params = {'q': 'Statue of Liberty', 'format': 'json', 'limit': 1}
resp = requests.get('https://nominatim.openstreetmap.org/search',
params=params, headers=headers)
data = resp.json()[0]
print(data['display_name'])
print(f"Lat: {data['lat']}, Lon: {data['lon']}")
print(f"Type: {data['type']}")
https://nominatim.openstreetmap.org/search?q=London&format=json&limit=1
API Details
- API URL
https://nominatim.openstreetmap.org- Documentation
- nominatim.org
- Category
- Utility
- Authentication
- Not Required
- Geographic Coverage
- Global
Frequently Asked Questions
- Do I need an API key?
- No, but you must provide a
User-Agentheader identifying your application. Requests without one may be blocked. - What is the rate limit?
- Maximum 1 request per second. For higher volume, you need to run your own Nominatim server using OpenStreetMap data exports.
- What output formats are supported?
format=json(standard),format=jsonv2(extended),format=xml, andformat=html. JSONv2 includes additional address breakdown fields.- Can I restrict results to a specific country?
- Yes, add
&countrycodes=USto limit results to a specific country using ISO 3166-1 alpha-2 codes. Use comma separation for multiple countries. - What does the reverse geocoding response include?
- It returns
display_name(full address),address(structured breakdown: road, city, state, postcode, country),lat,lon, and OSM metadata. - How does the search score work?
- Results include a
importancescore (0-1) based on OSM data quality and population. Higher importance results typically appear first.
What You Can Build
- Address autocomplete for checkout forms
- Map marker placement from address input
- Reverse geocoding for clickable maps
- Location-based search with coordinate boundaries
- Delivery route planner with address validation