Mah*_*hdi 5 java google-api google-api-java-client google-custom-search
我正在尝试将Google Custom Search API用于Java中的研究目的.因此,我需要为每个查询设置一个大的结果集.然而,似乎我受限于前100个结果,远远低于我的需要.我使用这样的list方法:
list.setStart(90L);
Run Code Online (Sandbox Code Playgroud)
当我将其设置为从索引100开始时,我收到此错误:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{ "code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Value",
"reason" : "invalid"
} ],
"message" : "Invalid Value"
}
Run Code Online (Sandbox Code Playgroud)
有没有办法消除这个限制?
两个限制之间存在差异:a)每天最多100个查询; b)每个搜索短语最多100个结果(甚至分成10个查询,每个查询10个结果).限制(a)可以通过支付给谷歌来解决,而限制(b)根本无法解决,它似乎是搜索整个网络时CSE产品的一个特征(即不仅仅是网站搜索,它可以给予更多结果),请参阅https://productforums.google.com/forum/#!topic/customsearch/VM8_6trCxGU
小智 0
对于 Google 自定义搜索,每个查询只能请求 10 个结果,因此您需要将该搜索拆分为多个查询。(我不知道你的实际查询代码是如何工作的,所以我不知道你是否已经知道这一点)
Google 自定义搜索(免费)每天也有 100 次查询的限制,因此如果您想要更多,则必须付费。
您可以在这里找到定价:https ://developers.google.com/custom-search/json-api/v1/overview
| 归档时间: |
|
| 查看次数: |
3834 次 |
| 最近记录: |