Exact name, typeahead, nearest, or nearby. Type, capital, district, elevation, id.
Look up a city by exact name. If several match, you get the largest by population. Optional ?country= and ?state= filters. Type, capital, district, elevation, and land area ride every record. Every response carries a stable id.
Coverage is curated per country from official national gazetteers: the US, Canada, Mexico, Brazil, Puerto Rico, the UK, Ireland, France, Spain, Belgium, the Netherlands, Germany, Austria, Switzerland, Liechtenstein, Italy, Portugal, Denmark, Sweden, Norway, Finland, Poland, Czechia, Japan, Taiwan, Australia, and New Zealand. A country outside the list returns an empty result.
curl "https://api.parseapi.com/city/charlotte" \
-H "X-API-Key: YOUR_API_KEY"{
"name": "Charlotte",
"local_name": null,
"type": "city",
"capital_of": null,
"state": "NC",
"state_name": "North Carolina",
"district": "37119",
"district_name": "Mecklenburg",
"country": "US",
"country_name": "United States",
"latitude": 35.209045,
"longitude": -80.83099,
"elevation": 209,
"elevation_ft": 686,
"population": 943476,
"area": 813.48,
"land_area": 808.33,
"water_area": 5.15,
"timezone": "America/New_York",
"id": "city_mb8mbqrkz8zb"
}Response fields
Prefix search for city pickers and typeahead. ?limit= caps results, default 10, max 50.
curl "https://api.parseapi.com/city?q=char&country=US&limit=10" \
-H "X-API-Key: YOUR_API_KEY"{
"q": "char",
"country": "US",
"cities": [
{
"name": "Charlotte",
"local_name": null,
"type": "city",
"capital_of": null,
"state": "NC",
"state_name": "North Carolina",
"district": "37119",
"district_name": "Mecklenburg",
"country": "US",
"country_name": "United States",
"latitude": 35.209045,
"longitude": -80.83099,
"elevation": 209,
"elevation_ft": 686,
"population": 943476,
"area": 813.48,
"land_area": 808.33,
"water_area": 5.15,
"timezone": "America/New_York",
"id": "city_mb8mbqrkz8zb"
},
{
"name": "Charleston",
"local_name": null,
"type": "city",
"capital_of": null,
"state": "SC",
"state_name": "South Carolina",
"district": "45019",
"district_name": "Charleston",
"country": "US",
"country_name": "United States",
"latitude": 32.828017,
"longitude": -79.972896,
"elevation": 6,
"elevation_ft": 20,
"population": 157665,
"area": 352.66,
"land_area": 298.6,
"water_area": 54.06,
"timezone": "America/New_York",
"id": "city_ngm2jafnwk7y"
},
// ... 8 more
]
}Response fields
Closest city to a lat/lon, with miles and km. Good for enriching a point with a place name.
curl "https://api.parseapi.com/city?lat=35.2271&lon=-80.8431" \
-H "X-API-Key: YOUR_API_KEY"{
"name": "Charlotte",
"local_name": null,
"type": "city",
"capital_of": null,
"state": "NC",
"state_name": "North Carolina",
"district": "37119",
"district_name": "Mecklenburg",
"country": "US",
"country_name": "United States",
"latitude": 35.209045,
"longitude": -80.83099,
"elevation": 209,
"elevation_ft": 686,
"population": 943476,
"area": 813.48,
"land_area": 808.33,
"water_area": 5.15,
"timezone": "America/New_York",
"distance": 0.4,
"distance_mi": 0.25,
"id": "city_mb8mbqrkz8zb"
}Response fields
Cities around a named place, nearest first, with miles and km. Default radius 40 km. ?unit=mi or legacy ?miles=. Radius is a query dial, never a path segment.
curl "https://api.parseapi.com/city/denver/nearby?miles=8&limit=3" \
-H "X-API-Key: YOUR_API_KEY"{
"city": "Denver",
"state": "CO",
"country": "US",
"radius": 8,
"unit": "mi",
"nearby": [
{
"name": "Glendale",
"local_name": null,
"type": "city",
"capital_of": null,
"state": "CO",
"state_name": "Colorado",
"district": "08005",
"district_name": "Arapahoe",
"country": "US",
"country_name": "United States",
"latitude": 39.703052,
"longitude": -104.936157,
"elevation": 1631,
"elevation_ft": 5351,
"population": 4465,
"area": 1.48,
"land_area": 1.47,
"water_area": 0.01,
"timezone": "America/Denver",
"distance": 8.06,
"distance_mi": 5.01,
"id": "city_5bjs2r33bamc"
},
// ... 2 more
]
}Response fields
Questions? Email