python - 使用 Google 自定义搜索 API 时为 "daily limit exceeded"

标签 python google-custom-search google-api-python-client

我想为大约 2000 个查询抓取 200 个结果,但它给我一个“超出每日限制”的错误。

我想确认我们每天可以抓取多少结果。有什么解决方案可以解决这个问题吗?或者唯一的方法是每天抓取一小部分查询...?

我抓取google的代码如下:

def crawl(query_list):
    http = httplib2.Http()

    # Construct the service object for the interacting with the CustomSearch API.
    service = discovery.build('customsearch', 'v1',  developerKey='my api key', http=http)

    res_list = []
    for query in query_list:
        json_res = service.cse().list(q = query, cx = 'my search engine id', num = 200,).execute()
        res_list.append(json_res)

谢谢!

最佳答案

根据这个post :

The first 100 queries per day are free. Any more, then you have to pay $5 per 1000 queries, for up to 10,000 queries per day, just enable billing to do so. Each query returns a maximum of 10 results, so you can retrieve 1000 URL’s from your search per day for free.

关于python - 使用 Google 自定义搜索 API 时为 "daily limit exceeded",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22902415/

相关文章:

python - 可以评论 pylint 注释

python - 如何去掉第一个和最后一个双引号?

使用谷歌自定义搜索 API 的 Java 代码

python - 如何在 Python/Pandas 中处理 "Object of type ' Timestamp' is not JSON Serialible”?

python - 自动认证--Google Calendar API

python - 矢量化批量图像像素查找 numpy 数组

python - 为什么我不能将 True 存储在 Set 中?

java - Google 自定义搜索引擎 Java 输出

android - CSE(自定义搜索引擎)步骤

python - 仅 Google 自定义搜索 Python 购物结果?