我的GooglePlaces API密钥已激活但不起作用

2024-06-25 22:39:14 发布

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

我使用this package在Python上运行googleplacesapi。我正在运行以下代码:

from googleplaces import GooglePlaces, types, lang
key='XXXXXXX'
google_places = GooglePlaces(key)

query_result = google_places.nearby_search(
    location='London, England', keyword='Fish and Chips',
    radius=20000, types=[types.TYPE_FOOD])

print(query_result)

但是当我这样做时,我得到了一个错误:

^{pr2}$

不过,我的API已启用,一切似乎都很酷,如下所示:

enter image description hereenter image description hereenter image description here

有人能帮忙吗?在


Tags: key代码fromimportpackagelanggoogleresult