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

I use google place api to search for specific types such as (gas_station, cafes, shopping_malls, etc.) here is a link I use 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 for all gas stations near my location, so here I get "

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

But there are some gas_stations in my location (I'm looking for a google map), since I can get these results, someone can help me.

Thanks for the promotion.

+6
source share
1 answer

The problem is categorizing the data. If you search for types=university , you will see a series of results. Now let's look at the types in these results - they are mainly listed as ["university", "establishment"] .

All gas stations in this area are only related to ["establishment"] , so they are not suitable for searching gas_station .

You can use the keyword search to return businesses with "gas% 20station" to your metadata. It seems to be returning the same results as searching for the β€œgas station” around this area on Google Maps.

+10
source

Source: https://habr.com/ru/post/904581/


All Articles