Google api 如何将PageSpeed Insights API与Google API Python客户端一起使用?

Google api 如何将PageSpeed Insights API与Google API Python客户端一起使用?,google-api,google-api-python-client,Google Api,Google Api Python Client,我目前正在使用Google api Python客户端开发PageSpeed Insights api。API客户端声明一次可以完成1000个请求。然而,在26次请求之后,我不断收到500个错误。对于PageSpeed Insights,是否有其他计算限制的方法 我目前的代码如下: from apiclient.http import BatchHttpRequest from apiclient.discovery import build # URL_LIST = [ 998 lenght

我目前正在使用Google api Python客户端开发PageSpeed Insights api。API客户端声明一次可以完成1000个请求。然而,在26次请求之后,我不断收到500个错误。对于PageSpeed Insights,是否有其他计算限制的方法

我目前的代码如下:

from apiclient.http import BatchHttpRequest
from apiclient.discovery import build

# URL_LIST = [ 998 lenghthed list of urls ]

def handle_metrics_results(request_id, response, exception):
        if exception is not None:
            # What say you?
            print 'Dude you fail! ' + str(exception)
        else:
            # Do something with result
            print 'Awesome! ' + str(response)

api_key = 'my_api_key'
insights_service = build('pagespeedonline', 'v2', developerKey=api_key)
insights_request_batch = BatchHttpRequest(callback=handle_metrics_results)
for one_url in URL_LIST:
    insights_request_batch.add(
        insights_service.pagespeedapi().runpagespeed(url=one_url))
insights_request_batch.execute()
你能给我指一下正确的方向吗?我真的不知道我做错了什么