Google Places API Search for Keyword and City

折月煮酒 提交于 2020-01-06 08:18:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!