Is it possible to search nearby cities with given city or latitude longitude using geocoding API?
For example user input City A
, then the result is a list of cities nearby to city A.
if not possible, do you have any suggestions for using other APIs or references that can be used?
What you should use is Nearby Search using Places API.
You can use the radius
parameter to limit the distance of nearby search and also specify the types
parameter depending on what you want or need.
You can use these types on their Table 3:
(regions)
type collection instructs the Places service to return any
result matching the following types:
- locality
- sublocality
- postal_code
- country
- administrative_area_level_1
- administrative_area_level_2
(cities)
type collection instructs the Places service to return results that match locality
or administrative_area_level_3
.Ref: Table 3: Type collections supported in Place Autocomplete requests
I recommend that you should read more from their docs if you want to learn more. here's the link to get started: Places API Docs
Hope this helps.