【问题标题】:How to get more than 5000 query from webmasters tools api?如何从站长工具 api 获得超过 5000 条查询?
【发布时间】:2015-12-03 13:41:56
【问题描述】:

我想知道是否有可能从网站管理员工具 API 获取超过 5000 条记录,因为最大限制是 5000 条记录。

这是我的代码:

//==========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();

正如您在分析 API 中所知道的,使用以下方法可以获得超过最大限制:

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

但在 webmasters tools api 中我找不到这些参数。

【问题讨论】:

    标签: php google-api-webmasters


    【解决方案1】:

    您不能在网站管理员工具 api 中使用分页,您不能使用 rowLimit 字段 (MAX 5,000) 增加您的计划帐户以在一次调用中获得更多记录。

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

    对不起

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-06
      • 1970-01-01
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      相关资源
      最近更新 更多