gpt4 book ai didi

google-places-api - 如何使用 Google Places API 获取城市或国家/地区的所有地点(或特定类型的地点,例如餐厅)?

转载 作者:行者123 更新时间:2023-12-03 08:57:01 24 4
gpt4 key购买 nike

例如,我正在尝试查找某个城市或国家/地区的所有“餐厅”或“保险公司”。好吧,也许一个国家太广阔了,但主要是大城市。

我正在使用 Google Places API 和 python,但我发现您只能使用“radius”参数或“rankby=distance”。问题是,根据文档,我相信每个查询只能在 3 页上返回 20 个结果,或 60 个结果(如果我错了,请纠正我)。因此,例如,如果我想查找纽约的所有餐馆,我必须从中心或其他地方开始并设置“rankby=distance”,以便它可以在设置的半径内为我提供 60 个最近的结果。但是我不知道我的下一个查询会是什么......

任何想法如何去做?

最佳答案

不幸的是,您无法从 Google Places API 获得超过 60 个结果;至少在不违反服务条款的情况下:

Unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), you must not: (d) use the Products in a manner that gives you or any other person access to mass downloads or bulk feeds of any Content, including but not limited to numerical latitude or longitude coordinates, imagery, and visible map data



此外,如您所见 here :

It's in large part a licensing issue. But it's also because the goal of the Places API is not to facilitate scraping or aggregation of Google Places data in the way you describe. Any application that does so is almost certainly not compliant with the Google Maps or Google Maps API Terms of Service, and is likely to be blocked from using the API or other Google services at any time. The Places API is intended to allow apps to offer their users a way to discover of identify Places nearby. There is a practical limit to the number of search results that a user will scan through and consider. I don't believe it's necessary to offer users 200 results, and I suspect that doing so would only serve to increase development of applications that scrape Google Places data, without adding significant benefit or utility to the types of apps the API is intended to serve, and that we wish to encourage.



作为进一步引用,还可以查看 this answer .

关于google-places-api - 如何使用 Google Places API 获取城市或国家/地区的所有地点(或特定类型的地点,例如餐厅)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14026759/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com