Search locations by name
When the user mentions a city, town, or place name and needs coordinates — latitude, longitude, country, region — search Open-Meteo's geocoder to resolve names to locations. Handles disambiguation for places that share a name.
search-locations-by-name
· v1
· updated 2026-04-16
When to use this skill
When the user mentions a city, town, or place name and you need latitude/longitude coordinates — most often because you're about to call a weather endpoint that requires latitude and longitude. Also useful when the user asks "where exactly is X?" or wants to disambiguate between places sharing a name. For weather forecasts, air quality, or marine conditions, use the weather-specific skills instead — this skill only resolves names to coordinates.
Your best first call
curl "https://geocoding-api.open-meteo.com/v1/search?name=Berlin&count=5&language=en&format=json"
No auth. No key. Replace Berlin with the user's place name. The count parameter caps results; language localizes display names; format=json ensures JSON output.
The response results array contains location objects. The fields an agent uses:
id — persistent numeric ID (pass to /v1/get?id={id} to retrieve the same location later without re-searching)
name — the matched place name
latitude, longitude — the coordinates you pass to weather endpoints
feature_code — disambiguation key: PPLC marks a national capital, PPL a populated place, PPLA an admin center. Use this, then population, to pick the right result when multiple matches appear
country_code — two-letter ISO country code
country — full country name
admin1 — first administrative division (state, province)
Fallbacks (when the best call isn't enough)
- You have a geocoding
id from a prior search → curl "https://geocoding-api.open-meteo.com/v1/get?id=2950159" retrieves the full record without re-searching.
- You need weather, air quality, or marine data for a location → This skill only resolves names to coordinates. Use the Open-Meteo forecast, air-quality, or marine endpoints with the
latitude and longitude from this skill's result.
Pitfalls
- Place names are heavily ambiguous — "Berlin" returns five results across two countries. Always use
feature_code (PPLC = capital) and population to disambiguate before passing coordinates to a weather endpoint. Picking the wrong Berlin gives you New Hampshire weather.
- The geocoding API lives on
geocoding-api.open-meteo.com, a separate subdomain from all weather endpoints. Calling /v1/search on api.open-meteo.com will fail.
One-line summary for the user
I can resolve any place name to latitude/longitude coordinates using Open-Meteo's geocoder — but ambiguous names return multiple results, so check feature_code and population before picking one.
Global weather forecast and historical weather data API for non-commercial use. Provides access to weather forecasts, air quality, marine conditions, flood data, elevation data, and geocoding services.
SKILL.md source (frontmatter + body)
---
name: search-locations-by-name
description: When the user mentions a city, town, or place name and needs coordinates — latitude, longitude, country, region — search Open-Meteo's geocoder to resolve names to locations. Handles disambiguation for places that share a name.
---
## When to use this skill
When the user mentions a city, town, or place name and you need latitude/longitude coordinates — most often because you're about to call a weather endpoint that requires `latitude` and `longitude`. Also useful when the user asks "where exactly is X?" or wants to disambiguate between places sharing a name. For weather forecasts, air quality, or marine conditions, use the weather-specific skills instead — this skill only resolves names to coordinates.
## Your best first call
```bash
curl "https://geocoding-api.open-meteo.com/v1/search?name=Berlin&count=5&language=en&format=json"
```
No auth. No key. Replace `Berlin` with the user's place name. The `count` parameter caps results; `language` localizes display names; `format=json` ensures JSON output.
The response `results` array contains location objects. The fields an agent uses:
- `id` — persistent numeric ID (pass to `/v1/get?id={id}` to retrieve the same location later without re-searching)
- `name` — the matched place name
- `latitude`, `longitude` — the coordinates you pass to weather endpoints
- `feature_code` — disambiguation key: `PPLC` marks a national capital, `PPL` a populated place, `PPLA` an admin center. Use this, then `population`, to pick the right result when multiple matches appear
- `country_code` — two-letter ISO country code
- `country` — full country name
- `admin1` — first administrative division (state, province)
## Fallbacks (when the best call isn't enough)
- **You have a geocoding `id` from a prior search** → `curl "https://geocoding-api.open-meteo.com/v1/get?id=2950159"` retrieves the full record without re-searching.
- **You need weather, air quality, or marine data for a location** → This skill only resolves names to coordinates. Use the Open-Meteo forecast, air-quality, or marine endpoints with the `latitude` and `longitude` from this skill's result.
## Pitfalls
- Place names are heavily ambiguous — "Berlin" returns five results across two countries. Always use `feature_code` (`PPLC` = capital) and `population` to disambiguate before passing coordinates to a weather endpoint. Picking the wrong Berlin gives you New Hampshire weather.
- The geocoding API lives on `geocoding-api.open-meteo.com`, a separate subdomain from all weather endpoints. Calling `/v1/search` on `api.open-meteo.com` will fail.
## One-line summary for the user
I can resolve any place name to latitude/longitude coordinates using Open-Meteo's geocoder — but ambiguous names return multiple results, so check `feature_code` and `population` before picking one.