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.

Coverage

Twenty-seven countries, each from its official national gazetteer.

  • United States
  • Puerto Rico
  • Canada
  • Mexico
  • Brazil
  • United Kingdom
  • Ireland
  • France
  • Spain
  • Portugal
  • Belgium
  • Netherlands
  • Germany
  • Austria
  • Switzerland
  • Liechtenstein
  • Italy
  • Denmark
  • Sweden
  • Norway
  • Finland
  • Poland
  • Czechia
  • Japan
  • Taiwan
  • Australia
  • New Zealand

Find a city by name, typeahead search with q, coordinates, or the towns around it. The largest name match wins a tie. Coordinate and nearby results include distance in miles and kilometers.

Each city includes its name, type, administrative location, coordinates, timezone, and stable id. name_local carries the native form when it differs. Paid deep adds population, area, elevation, and capital status to each record. Twenty-seven countries, each from official place records.

SPEED

How long /city takes.

Median time to first byte over the last seven days. Warm requests, measured every 30 minutes. Live verification and other request variants can take longer.

US

47ms

EU

108ms

APAC

154ms

LatAm

126ms

ME

90ms

See live status →

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

name
City name
name_local
Local-language name, null when absent or identical to name
type
What the place is in its own country's words (city, town, commune, ward)
state
State or province code
state_name
State or province name
district
District code the city sits in (US FIPS, FR INSEE, GB GSS)
district_name
District name
country
ISO2 country code
country_name
Country name
latitude
Latitude
longitude
Longitude
timezone
Timezone identifier
distance
Kilometers from query point (coords and nearby)
distance_mi
Miles from query point (coords and nearby)
id
Stable city id (city_...). Fetch again at /city/id/{id}

Deep fields

deep.capital_of
country when it is a national capital, state when it is a state or region capital, null otherwise
deep.elevation
Elevation in meters at the city center
deep.elevation_ft
Elevation in feet
deep.population
Population
deep.population_period
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.area
Total area in km² (land + water, or the official total)
deep.land_area
Land area in km² (null when the source publishes total only)
deep.water_area
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.

Put a name to the place.

City lookup and search on every plan. Place statistics on paid plans.

Start includes 1M API requests a month for $20/mo.