Google 地点 API - 附近搜索不按类型过滤

Google Places API - Nearby Search not filtering by type

以下URL请求未按类型过滤地点:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?type=establishment&location=-15.8374808,-48.0125697&radius=100&key=[YOUR_API_KEY_HERE]

查询字符串 type=establishment 未过滤 属性。

注意:将您的 Google API 键插入最后进行搜索。

编辑:我相信只有第一个结果不是过滤类型。是状态。

establishment 类型不在地点搜索的 supported types 列表中。

因此您的查询忽略了此类型过滤器,就好像您正在发出以下无类型请求一样:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-15.8374808,-48.0125697&radius=100&key=KEY

您需要使用受支持的类型,例如store:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?type=store&location=-15.8374808,-48.0125697&radius=100&key=KEY

希望对您有所帮助!