2

This question is an update to some outdated questions:


Because I need a way to get all near restaurants, stores, and churches I thought Google Places API seemed to do what I want, but I am having some trouble with filtering: I want to search for multiple places-types in one request.

let url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?"
url += "location=" + 79.999 + "," + 8.999
url += "radius=" + 2000
url += "type=" + mytype// ??
url += "key=" + mykey

This is what my url should look like. But I got trouble setting multiple types like:

Setting mytype to maybe "restaurant" is working quite fine.

Setting mytype to "restaurant,store,church" is not working.

Setting mytype to "[restaurant,store,church]" is also not working.


I know that the feature searching for multiple place types was disabled by Google a long time ago. But using the javascript API works absolutely fine with multiple types so the URL request probably should also work this way.

ekad
  • 14,436
  • 26
  • 44
  • 46

2 Answers2

2

Seperating the types with "|" is doing the job.

let mytype = "restaurant|food|store"
let url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?"
url += "location=" + 79.999 + "," + 8.999
url += "radius=" + 2000
url += "type=" + mytype// ??
url += "key=" + mykey

Volià, hope I could help.

Jonas0000
  • 1,085
  • 1
  • 12
  • 36
0

Using multiple types is not possible in Google Places

https://developers.google.com/places/web-service/search

Go through the above link:

Under Nearby Search requests section you will find the answer.

  • Thanks for your answer. Links are good for providing supporting documentation for the answer. But please include the actual answer in any answers. – Elletlar Jul 20 '18 at 11:09