0
votes

I am using google's places API to search for certain outlets.

Taking the outlet called 'Sangkaya' as an example (note: Sangkaya is an ice cream franchise), when I enter the following query, 8 Sangkaya outlets are returned.

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=3.081213,101.5844108&radius=50000&type=store&keyword=sangkaya&key=YourAPIKey

In the above query, I have passed 'store' to the type parameter, and 'sangkaya' to the keyword parameter.

However, when I use this next query, where I still pass 'store' to the type parameter, but without passing 'sangkaya' to the keyword parameter, the query results do not contain any Sangkaya outlets:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=3.081213,101.5844108&radius=50000&type=store&key=YourAPIKey

The values contained in the 'types' key for each outlet contains the value 'store'.

My question here is, why arent the 8 Sangkaya outlets being returned in the second query?

1

1 Answers

1
votes

Your second query does not return Sangkaya outlets because it has no reason to return them, it just returns "stores" within 50 km of 3.081213,101.5844108 without any preference in particular.

If you want to find the nearest results, use rankby=distance with either types or keyword, and beware the maximum radius is 7000 m.