GET/v1/cities
Find cities by name: coordinates, population, time zone and the local time there now
Cities of 15,000+ people worldwide. Name matches are prefix first, then substring; results are ordered by population, so q=paris puts Paris, France before Paris, Texas. Add country to narrow.
PARAMETERS
- qquery · stringREQUIRED
- City name (any script; ASCII spellings work too)e.g. denver
- countryquery · string
- ISO 3166-1 alpha-2e.g. US
- limitquery · integer
- Maximum resultse.g. 10
REQUEST
curl "https://api.apialmanac.com/v1/cities?q=denver" \ -H "X-API-Key: YOUR_KEY"
import requests
r = requests.get("https://api.apialmanac.com/v1/cities?q=denver", headers={"X-API-Key": "YOUR_KEY"})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.apialmanac.com/v1/cities?q=denver", {
headers: { "X-API-Key": "YOUR_KEY" }
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"count": 1,
"total": 1,
"cities": [
{
"id": 5419384,
"name": "Denver",
"ascii_name": "Denver",
"country": "US",
"admin1": "Colorado",
"admin1_code": "CO",
"lat": 39.7392,
"lon": -104.9847,
"population": 715522,
"elevation_m": 1609,
"timezone": "America/Denver",
"offset": "-06:00",
"abbreviation": "MDT",
"local_time": "2026-10-09T10:30:00-06:00"
}
],
"attribution": "City data © GeoNames (geonames.org), CC BY 4.0"
}