Google Places API:OVER_QUERY_LIMIT [英] Google Places API: OVER_QUERY_LIMIT

查看:97
本文介绍了Google Places API:OVER_QUERY_LIMIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一条错误消息,通知我超出了API配额.但是,我的配额为150,000个请求,仅用完了12,000个.是什么导致此错误?

I am getting an error notifying me of exceeding the API Quota. However, I have a quota of 150,000 requests and have only used up 12,000 of them. What is causing this error?

代码示例:

from googleplaces import GooglePlaces

api_key = ''
google_places = GooglePlaces(api_key)

query_result = google_places.nearby_search(location="Vancouver, Canada", keyword="Subway")
for place in query_result.places:
    print(place.name)

错误消息:

googleplaces.GooglePlacesError: Request to URL https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Vancouver%2C+Canada failed with response code: OVER_QUERY_LIMIT

推荐答案

错误消息中的请求不是Places API请求.这是地址解析API请求.

The request from error message is not a Places API request. This is Geocoding API request.

https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Vancouver%2C+Canada

它不包含任何API密钥.这意味着每天只有2500个没有API密钥的地理编码请求.同样,地理编码请求具有每秒查询限制(QPS),即每秒50个查询.您可能也超出了QPS限制.

It doesn't include any API key. That means you can have only 2500 daily geocoding requests without an API key. Also, geocoding requests have a query per second limits (QPS) which is 50 queries per second. You might be exceeding the QPS limit as well.

https://developers.google.com/maps/documentation/geocoding/usage-limits

不确定在实际上应调用Places API Web服务的库为何调用Geocoding API Web服务.如果Places API没有提供任何结果,也许这是一种后备方式.

Not sure why the library that supposed to be calling Places API web service in reality calls Geocoding API web service. Maybe this is some kind of fallback in case if Places API doesn't provide any result.

这篇关于Google Places API:OVER_QUERY_LIMIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆