GoogleV3的Geopy说只有几个请求就超过了配额

2024-06-30 15:50:26 发布

您现在位置:Python中文网/ 问答频道 /正文

代码:

    from geopy.geocoders import GoogleV3
for list in lista:
    'set place = the partial address data'
    place = list[0]
    geolocator = GoogleV3()
    'lookup location with geocoder'
    location = geolocator.geocode(place)
    'place the result in a sub-list with the original partial address'
    list[1] = (location.address)

我用python3和Geopy一起循环查看部分地址数据(街道和城市),用Geopy查找每个条目并返回完整地址(或者至少Google对完整地址的猜测)。在

代码可以工作,但是在运行完前4-5项后,它会抛出错误:

GeocoderQuotaExceeded: The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.

我没有付费api密钥可供使用,但在之前的研究中,我发现人们使用GoogleV3 geocoder时没有api密钥(每天的请求限制为1k)。在

你知道我的代码有什么问题吗?谢谢!在


Tags: the代码inaddress地址withplacelocation