Cities

Look up metadata for cities worldwide including population, IANA timezone, and geographic coordinates. Covers ~22,000 cities with a population above 15,000 from the GeoNames dataset.

Get API Key

Vue d'ensemble

Cas d'utilisation

  • Display city info in a travel or relocation app
  • Resolve a city name to coordinates for further lookups
  • Determine the timezone of a user-selected city
  • Power city-autocomplete search with population context

Fonctionnalités

~22,000 cities worldwide (population > 15,000)
Population, timezone, country, and coordinates in one response
Case-insensitive city name lookup
When multiple cities share a name, the most populous one is returned

Points de terminaison de l'API

Get City Info

Returns metadata for a city by name. Lookup is case-insensitive.

GET
https://requiems.xyz/v1/places/cities/{city}

Paramètres

Nom Type Requis Description
city string Requis City name to look up (e.g. london, tokyo, new york city)

Essayez-le

Démo en direct
Requête

City name to look up (e.g. london, tokyo, new york city)

Champs de réponse

Champ Type Description
name string Official city name as listed in the GeoNames dataset
country string ISO 3166-1 alpha-2 country code (uppercase)
population integer City population from the GeoNames dataset
timezone string IANA timezone identifier for the city (e.g. "America/New_York")
lat number Latitude of the city centre
lon number Longitude of the city centre

Exemples de code

curl "https://requiems.xyz/v1/places/cities/london" \
  -H "requiems-api-key: YOUR_API_KEY"

Réponses d'erreur

not_found

No city with that name was found in the dataset.

internal_error

Unexpected server error.

Foire aux questions