2
votes

I am performing a query using Google Places API to search for local restaurants

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=..lat,..lon&radius=..radius&type=restaurant&key=..key

However, I am receiving a lot of results for locations that are not primarily restaurants, for example:

  • Popular hotels with restaurants
  • Food delivery services
  • Night clubs
  • Department stores with dining
  • etc.

Ideally I would like to restrict my query to only a few types or prohibit certain types by query. Otherwise I would need to do this manually or find another service.

1

1 Answers

-2
votes

Just add the city name as a prefix in the search string. It will only give the search suggestions in which the user is searching. eg, pass "NewYork" as a prefix in your search string, now type any word, it will only give you results for NewYork city restaurant, cafes, places, etc