Free cities API

Search 34,000 cities and 13 million places — by name, country or coordinates. No API key, one request.

  • No cities found.
Ranked by population · click for the full record

Why

Cities & places, search-ready

34k cities, 13M places

Curated cities plus the full GeoNames gazetteer — mountains, lakes, parks and landmarks.

Search & autocomplete

Accent-insensitive name match, ranked by population, filterable by country.

Coordinates & nearest

Every place has lat/lng and a timezone. Reverse-geocode any point to its nearest cities.

Quick start

One request, no setup

No keys to generate and nothing to install — call an endpoint and parse the JSON.

Search cities

curl "https://countries.dev/cities?q=tokyo"

Biggest cities in a country

curl "https://countries.dev/cities?country=JP&limit=10"

Reverse geocode a point

curl "https://countries.dev/cities/near?lat=48.85&lng=2.35"

Search the full gazetteer

curl "https://countries.dev/places?q=everest"

Use it for

What developers build with it

City autocomplete

Drop-in suggestions for sign-up, search and address fields.

Reverse geocoding

Turn a user’s coordinates into the nearest city, with distance.

Maps & enrichment

Plot places, find landmarks, or attach coordinates and population to your data.

Cities API — FAQ

Is the cities API free?

Yes — no API key, no sign-up and no quota tier. Use it in production or side projects.

Is it a GeoNames API alternative?

It is built on GeoNames data and serves it over a fast, keyless REST API: ~34,000 curated cities and around 13 million named places (the full gazetteer).

Can I build a city autocomplete with it?

Yes. GET /cities?q=par returns matching cities ranked by population — accent- and punctuation-insensitive — which is exactly what an autocomplete needs.

Does it do reverse geocoding?

Yes. GET /cities/near?lat=&lng= returns the nearest cities to a coordinate with a distance, and /places/near does the same across all feature types.

What does a city record include?

Name, country code, latitude, longitude, population, timezone, admin region and the GeoNames id — as JSON.

Do I need an API key?

No. GET the endpoint and parse the JSON; CORS is permissive, so it works from the browser too.

Search your first city

GET countries.dev/cities?q=tokyo — ranked by population. The docs cover search, filters and reverse geocoding.