如何从Google Custom Search API获取100多个结果 [英] How to get more than 100 results from Google Custom Search API

查看:163
本文介绍了如何从Google Custom Search API获取100多个结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google自定义搜索API进行Java研究.结果,我将需要为每个查询设置一个大结果集.但是,似乎我对前100个结果的了解有限,远低于我需要的结果.我使用这样的列表方法:

I am trying to use Google Custom Search API for research purposes in Java. As a result I'm gonna need a big result set for each query. However it seems that I'm limited with first 100 results which is much less than what I need. I use the list method like this:

list.setStart(90L);

当我将其设置为从索引100开始时,会出现此错误:

And when I set it to start from index 100 I get this error:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request

{   "code" : 400,   
    "errors" : [ {
    "domain" : "global",
    "message" : "Invalid Value",
    "reason" : "invalid"   
  } ],   
    "message" : "Invalid Value" 
}

有什么方法可以消除此限制?

Is there any way to remove this limitation?

推荐答案

两个限制之间有区别:a)每天最多100个查询; b)每个搜索词组最多100个结果(甚至分为10个查询,每个查询10个结果).局限性(a)可以通过向Google付费来解决,而局限性(b)根本无法解决,这似乎是CSE产品在搜索整个网络时的一项功能(即不仅仅是网站搜索,它可以更多结果),请参见例如 https://productforums.google.com/forum/#!topic/customsearch/VM8_6trCxGU

There's a difference between two limitations: a) max 100 queries per day; and b) max 100 results per searched phrase (even split into 10 queries of 10 results per query). The limitation (a) can be solved by paying to Google, whereas limitation (b) cannot be solved at all, it seems to be a feature of the CSE product when searching the whole web (i.e. not just a site search, which can give more results), see e.g. https://productforums.google.com/forum/#!topic/customsearch/VM8_6trCxGU

这篇关于如何从Google Custom Search API获取100多个结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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