Open-Meteo Geocoding API
Free geocoding API with no key: convert a city or place name into latitude and longitude, with population, country and timezone. Tested curl example and live JSON.
Endpoint tested and returned HTTP 200 on 19 Aug 2026
What is the Open-Meteo Geocoding API?
The Open-Meteo Geocoding API is a free, key-free API that converts a place name into latitude and longitude, returning country, admin region, population, elevation and timezone for each match.
Almost every weather or mapping feature needs the same first step: turn what the user typed into coordinates. This endpoint does exactly that, with no key, and pairs naturally with the Open-Meteo forecast API which expects a latitude and longitude.
Results are ranked with population as a strong signal, which matters more than it sounds — searching a name shared by many towns returns the largest first, which is almost always what a user typing into a search box meant.
Quick facts
- Base URL
https://geocoding-api.open-meteo.com/v1- Authentication
- No API key required.
- Rate limit
- Shares the Open-Meteo fair-use policy — roughly 10,000 requests per day per IP.
- Pricing
- Free, commercial use permitted under the daily limit.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Open-Meteo Geocoding API
Every request below was executed against the live API on 19 Aug 2026, and the response shown is the real body it returned — not an illustration.
1. Look up coordinates for Lahore
GET https://geocoding-api.open-meteo.com/v1/search?name=Lahore&count=1
curl 'https://geocoding-api.open-meteo.com/v1/search?name=Lahore&count=1'const res = await fetch("https://geocoding-api.open-meteo.com/v1/search?name=Lahore&count=1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://geocoding-api.open-meteo.com/v1/search?name=Lahore&count=1", timeout=20)
res.raise_for_status()
print(res.json()){
"results": [
{
"id": 1172451,
"name": "Lahore",
"latitude": 31.558,
"longitude": 74.35071,
"elevation": 216.0,
"feature_code": "PPLA",
"country_code": "PK",
"admin1_id": 1167710,
"admin2_id": 1172449,
"timezone": "Asia/Karachi",
"population": 13004135,
"country_id": 1168579,
"country": "Pakistan",
"admin1": "Punjab",
"admin2": "Lahore District"
}
],
"generationtime_ms": 0.5505085
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Required | Place name to search. Two characters minimum; partial names match by prefix. Lahore |
count | integer | Optional | Number of results, 1 to 100. Defaults to 10. 1 |
language | string | Optional | Two-letter language code for localised place names. en |
format | string | Optional | `json` (default) or `protobuf`. json |
Response fields
results[].latitude / longitudefloat- Coordinates to feed straight into a weather or map request.
results[].namestring- Resolved place name in the requested language.
results[].country / country_codestring- Country name and ISO-3166 alpha-2 code.
results[].admin1string- First-level administrative division — state, province or region.
results[].populationinteger- Population, useful for disambiguating same-named towns.
results[].timezonestring- IANA timezone identifier for the location.
What you can build with the Open-Meteo Geocoding API
- Power a city autocomplete box in a weather or travel app
- Convert user-entered place names into coordinates before calling a forecast API
- Disambiguate duplicate city names using population and admin region
- Look up a location's IANA timezone without a separate timezone API
Common errors and how to fix them
400
The `name` parameter is missing or shorter than two characters.
Fix: Require at least two characters client-side before firing the request.
200 with no `results` key
No match was found — this is not an HTTP error.
Fix: Always check whether `results` exists before indexing into it; the key is omitted rather than returned empty.
Open-Meteo Geocoding API — frequently asked questions
Is there a free geocoding API without an API key?
Yes. The Open-Meteo Geocoding API converts place names to coordinates with no key or signup, and permits commercial use under its fair-use limit. Nominatim from OpenStreetMap is the other key-free option.
Does this API do reverse geocoding?
No. It only resolves names to coordinates. For coordinates back to an address, use the Nominatim API from OpenStreetMap instead.
Why does my search return no results field at all?
When nothing matches, the API returns HTTP 200 with the `results` key omitted entirely rather than an empty array. Code that assumes an array will throw, so check for the key's presence first.
How are multiple matches ordered?
By relevance with population weighted heavily, so the largest well-known place for a given name comes first — usually what a user searching that name intended.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Unit Converter
Convert between units of length, weight, temperature, area, volume, speed, time and data storage instantly, with a swap button and common conversion tables.
Alternatives to Open-Meteo Geocoding API
If Open-Meteo Geocoding does not fit, these weather apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| Open-Meteo | Free weather forecast API with no API key and no signup. Hourly and daily forecasts worldwide, free for commercial use. Working curl example and live response. | No key | Yes | 19 Aug 2026 |
| Open-Meteo Air Quality | Free air quality API with no key: PM2.5, PM10, ozone, nitrogen dioxide, European and US AQI plus pollen forecasts worldwide. Tested curl example included. | No key | Yes | 19 Aug 2026 |
| wttr.in | wttr.in is a free console-oriented weather API with no key. Get weather as plain text, ASCII art, PNG or full JSON with one curl command. Live example included. | No key | Yes | 19 Aug 2026 |
| MET Norway Locationforecast | Free Norwegian Meteorological Institute weather API with no key: hourly global forecasts with temperature, wind, pressure and precipitation. Tested example. | No key | Yes | 20 Aug 2026 |
| openSenseMap | Free citizen weather station API with no key: read any senseBox's sensors and their latest measurements, from temperature and humidity to particulates. Tested example included. | No key | Yes | 21 Aug 2026 |
| RainViewer | Free weather radar API with no key: a manifest of past and forecast radar frames worldwide, each resolving to standard map tiles you can overlay. Tested example included. | No key | Yes | 21 Aug 2026 |
Open-Meteo Geocoding is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 19 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.