You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Google Places API附近搜索中规避大气数据等额外计费

解决Google Places API (Classic) 额外收费问题

要避免被收取联系数据和大气数据的额外费用,只需在你的请求URL中添加fields参数,明确指定仅返回你需要的地点名称字段即可:

修改后的请求URL代码:

url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=" & myKeyword & "&location=" & mylatitude & "," & mylongitude & "&radius=" & myRadius & "&type=" & myplaceType & "&fields=name&key=" & myApiKey

关键说明:

  • fields=name 参数会强制API仅返回地点名称相关的JSON数据,不会返回触发额外收费的联系信息、大气数据等冗余字段。
  • 如果后续需要其他基础字段(比如地点ID),可以用逗号分隔添加,例如 fields=name,place_id,但当前需求仅需名称,保留name即可。

内容的提问来源于stack exchange,提问作者Ramesh Karunakaran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 15:52:02