Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I search places with specific types using Google Places API?

I am using google place api to search specific types like(gas_station,cafes,shopping_malls etc...) here is link i am using https://maps.googleapis.com/maps/api/place/search/json?location=41.104805,29.024291&radius=50000&types=gas_station&sensor=false&key=AIzaSyAhVKOOLN1lx6iKKnbXMT82W1cKG7O8cDY

so here i need to search all gas_stations nearby my location so here i get "

results" : [],
   "status" : "ZERO_RESULTS"

But in my location some gas_stations are there(i search google map) so how can i get these results can any one help me..

Thanks for advance.

like image 589
Chithri Ajay Avatar asked Dec 28 '11 06:12

Chithri Ajay


1 Answers

The problem is with the categorization of the data. If you do a search for types=university you'll see a number of results. Now look at the types in those results - they're listed mostly as ["university", "establishment"].

All of the gas stations in the area are only categorized as ["establishment"], so they're not coming up in your search for gas_station.

You could use the keyword search to return businesses with "gas%20station" in their metadata. It seems to return the same results as searching for "gas station" around that area in Google Maps.

like image 92
Mike Jeffrey Avatar answered Nov 07 '22 23:11

Mike Jeffrey