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 2026-08-19
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 2026-08-19, 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.
Open-Meteo Geocoding is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.