0

I tried to google place API to get a list of all important sub-location within a city but it's not showing the complete list.It gives the result on the basis of some search like restaurant and all. Is there any API to get a list of all sub-location within the city on the basis of city name?

1 Answers1

0

try something as mentioned below:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=28.7041,77.1025&radius=50000&key=YOUR_API_KEY.

The link of format:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=[LATITUDE AND LONGITUDE OF CITY]&radius=50000[I have specified 50KM which is largest google api allows]&key=YOUR_API_KEY.

Do not specify the type. radius: you get the approx size of city to restrict the value for radius.

akshaya pandey
  • 997
  • 6
  • 16
  • Thanks @akshaya , I tried this it's working fine but I have some doubt in this. 1) if I am giving some radius it might be the case it will show the area from another nearest city also.(As I need only the area in particular city). 2) The api returning only 20 record at a time is it possible to get all the data at the same time. –  Nov 07 '17 at 07:12
  • Please refer to the API doc at the linke below. https://developers.google.com/places/web-service/search You can set the value of pageToken in your request to retrieve more results in a singly query. The default value is 20. I am not sure how to restrict results to the city, hence, advised setting radius value approximated to size of city. The following link may give you some ideas on that. https://stackoverflow.com/questions/33214788/how-to-restrict-google-places-to-specific-city – akshaya pandey Nov 07 '17 at 07:19