GeoDB City API - Find Cities For Your Criteria | Wirefree Thought

header photo

Getting Cities & Suburbs For a metropolitan area

1. First, find the metropolitan city from the list of cities with populations greater than some number defining a metropolis for your case (500,000 in the example below):

curl --get --include '' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host:'

2. Now find all cities within some regional radius of some city from the previous results:

curl --get --include '{cityId}/nearbyCities?radius={radius}&distanceUnit={distanceUnit}&minPopulation={minPopulation}&sort={sort}=offset=0&limit=500' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host:'


minPopulation Only cities having at least this population
radius The location radius in which to find cities
distanceUnit MI (miles) or KM (kilometers)
sort Optionally, how to sort the results. Format: ±SORT_FIELD,±SORT_FIELD where SORT_FIELD = countryCode | elevation | name | population