我已实施自定义搜索,并尝试获取下一页结果:
<?php
require __DIR__ . '/vendor/autoload.php';
$client = new Google_Client();
$client->setApplicationName("AAAAAAAAAA");
$client->setDeveloperKey("xxxxxxxxxxxxxxxx");
$service = new Google_Service_Customsearch($client);
//Do the query
$query = 'a';
$optParams = array(
'num' => 10,
'cx' => 'cxcxcxcxcxcxcxcxcxcxcxcx'
);
$results = $service->cse->listCse($query, $optParams);
print_r($results);
如何获得下一组结果?文档说应该使用num和start,即&amp; num = 10&amp; start = 21 但我总是得到0结果。更糟糕的是:更改启动参数会更改结果的数量:
生成的URI给出(当然,我使用正确的key参数运行查询): https://www.googleapis.com/customsearch/v1?q=a&cx=009948471157722620218%3Aqb_f79-w5zg
我在做什么/在哪里出错?任何帮助将不胜感激!