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.
Overview
Use Cases
- 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
Features
~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
API Endpoints
Get City Info
Returns metadata for a city by name. Lookup is case-insensitive.
GET
https://api.requiems.xyz/v1/places/cities/{city}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| city | string |
Required | City name to look up (e.g. london, tokyo, new york city) |
Try it out
Live DemoRequest
City name to look up (e.g. london, tokyo, new york city)
Sending request...
Response Fields
| Field | 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 |
Code Examples
curl "https://api.requiems.xyz/v1/places/cities/london" \
-H "requiems-api-key: YOUR_API_KEY"
import requests
url = "https://api.requiems.xyz/v1/places/cities/london"
headers = {"requiems-api-key": "YOUR_API_KEY"}
response = requests.get(url, headers=headers)
data = response.json()
print(data["data"]["timezone"]) # Europe/London
const response = await fetch(
'https://api.requiems.xyz/v1/places/cities/london',
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const data = await response.json();
console.log(data.data.timezone); // Europe/London
require 'net/http'
require 'json'
uri = URI('https://api.requiems.xyz/v1/places/cities/london')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)
puts data['data']['timezone']
Error Responses
not_found
No city with that name was found in the dataset.
internal_error
Unexpected server error.
Frequently Asked Questions
The dataset covers approximately 22,000 cities worldwide with a population above 15,000, sourced from GeoNames (cities15000).
No. City names are normalised to lowercase before lookup, so "London", "LONDON", and "london" all return the same result.
The most populous city with that name is returned. For example, "london" returns London, UK rather than London, Ontario, Canada.
Yes. Pass the full city name in the URL path, for example /v1/places/cities/new%20york%20city or /v1/places/cities/new york city.