Googleカスタム検索APIを使用し、複数の結果ページを繰り返すスクリプトがあります。Googleカスタム検索API start = 100はエラー400を発生させます
https://www.googleapis.com/customsearch/v1?key=[[KEY]]&num=10&hl=en&start=0&cx=[[CX]]&q=%22bank%22&sort=date&googlehost=www.google.com
https://www.googleapis.com/customsearch/v1?key=[[KEY]]&num=10&hl=en&start=10&cx=[[CX]]&q=%22bank%22&sort=date&googlehost=www.google.com
https://www.googleapis.com/customsearch/v1?key=[[KEY]]&num=10&hl=en&start=20&cx=[[CX]]&q=%22bank%22&sort=date&googlehost=www.google.com
上記のすべての例で私は適切な回答を得ています。クエリ応答は、検索結果が17,900件であると主張しています。
https://www.googleapis.com/customsearch/v1?key=[[KEY]]&num=10&hl=en&start=100&cx=[[CX]]&q=%22bank%22&sort=date&googlehost=www.google.com
Iは、以下の反応(これはPHPオブジェクトに変換JSON応答である)を受信する:これは、それにもかかわらずである
stdClass Object (
[error] => stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[domain] => global
[reason] => invalid
[message] => Invalid Value
)
)
[code] => 400
[message] => Invalid Value
))
をスクリプトしかし、100 =開始達する 私はスタートで受け取る結果= 90次のページが存在する主張:APIで遊んで
"nextPage": [
{
"title": "Google Custom Search - \"bank\"",
"totalResults": "17900",
"searchTerms": "\"bank\"",
"count": 10,
"startIndex": 100,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "[[CX VALUE]]",
"sort": "date",
"googleHost": "www.google.com",
"hl": "en"
}
]
はこの無効な値の誤差が正確に秒を表示されていることを示していますタート= 92。 さらに、これはすべてのキーワード検索でこのエラーが表示される正確なページです。 問題のお手伝いをいただければ幸いです。これはGoogleカスタム検索の無料版なのでこれですか?