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

Descripción general

Casos de uso

  • 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

Funcionalidades

~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

Puntos finales de la API

Get City Info

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

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

Parámetros

Nombre Tipo Obligatorio Descripción
city string Obligatorio City name to look up (e.g. london, tokyo, new york city)

Pruébalo

Demostración en vivo
Solicitud

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

Campos de respuesta

Campo Tipo Descripción
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

Ejemplos de código

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

Respuestas de error

not_found

No city with that name was found in the dataset.

internal_error

Unexpected server error.

Preguntas frecuentes