问题
I would like to allow users to search for a keyword + city to return results for that keyword in a city.
For example "starbucks Seattle" should return all starbucks in Seattle.
However, it doesn't seem that keyword search includes cities - and so "starbucks seattle" just returns nothing.
I think the autocomplete api has such functionality, but the places api does not.
Any suggestions?
回答1:
Try using the Places API Textsearch endpoint:
https://maps.googleapis.com/maps/api/place/textsearch/json?query=starbucks+seattle&sensor=false&key=YOUR_API_KEY
来源:https://stackoverflow.com/questions/13963891/google-places-api-search-for-keyword-and-city