GET /city/{name} · /{name}/nearby · ?lat=&lon=

City API

Pass a name, a search, or coordinates. Get the city, then what is around it.

Try it

Example response/city/charlotte
{
  "name": "Charlotte",
  "name_local": null,
  "type": "city",
  "state": "NC",
  "state_name": "North Carolina",
  "district": "37119",
  "district_name": "Mecklenburg",
  "country": "US",
  "country_name": "United States",
  "latitude": 35.209045,
  "longitude": -80.83099,
  "timezone": "America/New_York",
  "id": "city_mb8mbqrkz8zb",
  ?deep=true
}

1M requests · $20/mo. Get started

What comes back.

name

City name

type

What the place is in its own country's words (city, town, commune, ward)

deep.capital_of

country when it is a national capital, state when it is a state or region capital, null otherwise

district

District code the city sits in (US FIPS, FR INSEE, GB GSS)

country

ISO2 country code

deep.elevation

Elevation in meters at the city center

deep.area

Total area in km² (land + water, or the official total)

id

Stable city id (city_...). Fetch again at /city/id/{id}

nearby

Cities inside the radius, nearest first, each with distance and distance_mi

distance

Kilometers from query point (coords and nearby)

distance_mi

Miles from query point (coords and nearby)

1

Pass a name

The largest match wins a tie. Native name when it differs.

2

Search, pin, or nearby

q for typeahead. lat/lon for the nearest place. /nearby for the towns around it.

3

Official sources

Place records from 27 countries. Unknown fields stay null.

Make your first request.

One key works across the APIs. Copy a request in your language and get JSON back.

curl "https://api.parseapi.com/city/charlotte" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Parse-Version: 2.0.0"
// Example response · 200
{
  "name": "Charlotte",
  "name_local": null,
  "type": "city",
  "state": "NC",
  "state_name": "North Carolina",
  "district": "37119",
  "district_name": "Mecklenburg",
  "country": "US",
  "country_name": "United States",
  "latitude": 35.209045,
  "longitude": -80.83099,
  "timezone": "America/New_York",
  "id": "city_mb8mbqrkz8zb"
}

API referenceSDKsKeys and authentication

Every response field

Response fields

namestring or null
City name
name_localstring or null
Local-language name, null when absent or identical to name
typestring or null
What the place is in its own country's words (city, town, commune, ward)
statestring or null
State or province code
state_namestring or null
State or province name
districtstring or null
District code the city sits in (US FIPS, FR INSEE, GB GSS)
district_namestring or null
District name
countrystring or null
ISO2 country code
country_namestring or null
Country name
latitudenumber or null
Latitude
longitudenumber or null
Longitude
timezonestring or null
Timezone identifier
distancenumber
Kilometers from query point (coords and nearby)
distance_minumber
Miles from query point (coords and nearby)
idstring or null
Stable city id (city_...). Fetch again at /city/id/{id}

Deep fields

deep.capital_ofstring or null
country when it is a national capital, state when it is a state or region capital, null otherwise
deep.elevationinteger or null
Elevation in meters at the city center
deep.elevation_ftinteger or null
Elevation in feet
deep.populationinteger or null
Population
deep.population_periodstring or null
Observation year or multi-year period for this population estimate (YYYY or YYYY-YYYY). Null when the record has no verified period or population. Never the import date.
deep.areanumber or null
Total area in km² (land + water, or the official total)
deep.land_areanumber or null
Land area in km² (null when the source publishes total only)
deep.water_areanumber or null
Water area in km² (null when the source publishes total only)

Build with City

All tutorials →

Miles and kilometers between two cities with the city distance tool.

QUESTIONS

When do I use which?
A name pins one city. /nearby lists the towns around it. lat and lon finds the nearest, plus distance.
What comes back?
Name, type, administrative location, coordinates, timezone, and stable id. name_local holds the native form when it differs. Paid deep adds capital status, elevation, population, and area to each city record.
What is the id?
A pin for that city. Fetch it again at /city/id/{id}. The name path stays the usual way in.
What is name_local?
The native form when it differs from name. Tokyo is Tokyo. name_local reads 東京. It is null when absent or identical to name.
How do I find nearby cities?
GET /city/{name}/nearby. Default radius 40 km. Distance comes back in miles and kilometers on every row.
How do I find the nearest?
Pass lat and lon. Distance comes back in miles and kilometers.
Which countries?
Twenty-seven, each from its official national gazetteer. Listed below.
What does population cover?
The source's published place boundary. Matched cities and towns in England and Wales use 2021 built-up areas, with counts rounded to the nearest five. Scotland uses 2022 localities. Northern Ireland uses exact 2021 census counts within 2015 settlement boundaries. Places without a reliable match return null.
What does London's population cover?
Greater London: its 32 boroughs plus the City of London. The mid-2025 estimate is 9,122,909 residents. The separate City of London and City of Westminster records use their own administrative areas and mid-2025 estimates.