Skip to content
GET /v1/city

A single city by GeoNames id

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/cities-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/cities-api/v1/city" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/cities-api/v1/city", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/cities-api/v1/city");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/cities-api/v1/city",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "id": 2950159,
        "name": "Berlin",
        "ascii": "Berlin",
        "admin1": "16",
        "country": "DE",
        "latitude": 52.52437,
        "timezone": "Europe/Berlin",
        "longitude": 13.41053,
        "population": 3426354,
        "elevation_m": 74,
        "country_name": "Germany"
    },
    "meta": {
        "timestamp": "2026-05-30T23:56:39.891Z",
        "request_id": "71c5bd5a-cebc-42f8-8e94-599102c13cf2"
    },
    "status": "ok",
    "message": "City retrieved",
    "success": true
}