イム:どのようにPHPのAPIからすべてのGoogle検索結果を取得するには?このコードを使用して
function doGoogleSearch($searchTerm)
{
//$cx="002000009380213215808:hf9v-g9oyho";
$endpoint = 'web';
$key= 'XXX';
$url = "http://ajax.googleapis.com/ajax/services/search/".$endpoint;
$args['q'] = $searchTerm;
$args['v'] = '1.0';
$url .= '?'.http_build_query($args, '', '&');
$ch = curl_init()or die("Cannot init");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$body = curl_exec($ch)or die("cannot execute");
curl_close($ch);
//decode and return the response
return json_decode($body,1);
}
これを使用することでは、私はちょうどグーグルの全検索結果を取得する方法があるit.Isから第1 '4の結果を得ましたか。
限定された検索にアクセスGoogle?それはこのスタート= xxxは似ているのですか? –
が得られました.thanx alot.iはstartの値を変更して全体の結果を得ることができます。 –
Array([responseData] => [responseDetails] =>範囲外の開始[responseStatus] => 400) –