How to get more than 5000 query from webmasters tools api?

流过昼夜 提交于 2019-12-11 12:43:02

问题


I want to know if there is a possibility to get more than 5000 records from webmasters tools API as the max limit is 5000 records.

Here is my code :

//==========INITIALISE CLIENT==========//
$client->setAccessToken($code_webmasters);
$webmastersService = new Google_Service_Webmasters($client);
$searchanalytics = $webmastersService->searchanalytics;
//=====================================//
$date = "2015-11-22";
$request = new Google_Service_Webmasters_SearchAnalyticsQueryRequest;
$request->setStartDate($date);
$request->setEndDate($date);
$request->setDimensions(array('query'));
$request->setSearchType("web");
$request->setRowLimit(5000);
$qsearch = $searchanalytics->query($site['name'], $request);
$rows = $qsearch->getRows();

As you know in analytics API it is possible to get more than the max limit by using :

'start-index' => 1, 'max-results' => 10000

But in webmasters tools api I can't find those parameters.


回答1:


You can't use pagination in webmasters tools api, You can't increase your plan account to get more records in one call using rowLimit field (MAX 5,000) .

Source: https://developers.google.com/webmaster-tools/v3/searchanalytics/query

Sorry



来源:https://stackoverflow.com/questions/34067587/how-to-get-more-than-5000-query-from-webmasters-tools-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!