City API

153,765 cities, each with a point on the map.

Cities, towns and settlements worldwide, each with its parent state and country, coordinates, IANA timezone and native name. Includes nearby search and autocomplete, so you can build a real location picker rather than a long select box.

153,765 cities and settlements
19 fields per record
3,000 free requests / mo
Request200 OK
curl --location 'https://api.countrystatecity.in/v1/countries/IN/states/MH/cities' \
  --header 'X-CSCAPI-KEY: YOUR_API_KEY'
Response
{
  "id": 57606,
  "name": "Mumbai",
  "native": "मुंबई",
  "kind": "settlement",
  "state_code": "MH",
  "country_code": "IN",
  "latitude": "19.07283000",
  "longitude": "72.88261000",
  "timezone": "Asia/Kolkata",
  "wikiDataId": "Q1156"
}

Endpoints

Every path below is live on https://api.countrystatecity.in/v1 and takes your key in the X-CSCAPI-KEY header.

GET/countries/{ciso}/citiesEvery city in a country
GET/countries/{ciso}/states/{siso}/citiesCities within one state
GET/search/autocompleteType-ahead for a location picker
GET/search/nearbyCities near a latitude and longitude
GET/timezone/{ciso}/{siso}/{city_id}Timezone for a given city

19 fields on every city.

Take them all, or name the ones you want with ?fields= and keep the response small.

idStable numeric identifier
nameEnglish name
nativeName in the local script
kindsettlement, county or administrative unit
typecity, town, village and so on
levelDepth in the official hierarchy
parent_idContaining division, where one exists
state_idParent state id
state_codeParent state code
country_idParent country id
country_codeParent country ISO2
latitudePoint latitude
longitudePoint longitude
timezoneIANA zone
populationLatest published figure
translationsName in other languages
wikiDataIdWikidata item

What people build with it.

  • The third dropdown in an address form, or a type-ahead that replaces all three.
  • Showing the right local time for a user without asking them to pick a timezone.
  • Finding the nearest serviceable city to a dropped pin, through /search/nearby.
  • Seeding a store locator or coverage map with real coordinates rather than geocoding every row.

Questions.

How many cities does the API cover?

153,765 cities, towns and settlements across 250 countries. Each one carries its parent state and country, so you never have to guess which Springfield you have.

Is there an autocomplete endpoint?

Yes. GET /search/autocomplete is built for type-ahead and returns ranked matches across countries, states and cities in one response.

Do cities come with coordinates and timezones?

Yes, latitude and longitude on every record and an IANA timezone such as Asia/Kolkata, which is what date libraries expect.

Can I find cities near a point?

Yes, GET /search/nearby takes a latitude, a longitude and a radius, and returns the cities inside it ordered by distance.

Free up to 3,000 requests a month.

Paid plans from $5 add higher limits. Supporter adds fuzzy search; Professional adds GraphQL and the change feed.