How to get crawl stats FROM webmaster tools api

我是研究僧i 提交于 2019-12-13 04:09:10

问题


I want to get this graph datas :

I can't add an image here : graph.png I don't have the reputation 10.

So I want to get for each day the 3 values (Pages crawled per day, kilobytes downloaded per day, time spent downloading a page)

the idea is to get an array like this :

$datas['2015-11-20']['pages_crawled'] = 125;
$datas['2015-11-20']['kilobytes'] = 1452;
$datas['2015-11-20']['time_spent'] = 1023;


$datas['2015-11-21']['pages_crawled'] = 146;
$datas['2015-11-21']['kilobytes'] = 2410;
$datas['2015-11-21']['time_spent'] = 1563;

$datas['2015-11-22']['pages_crawled'] = 102;
$datas['2015-11-22']['kilobytes'] = 1560;
$datas['2015-11-22']['time_spent'] = 1400;

Something like this.

thanks specially to @alex for his greathfull Help.


回答1:


Unfortunately you can't get this Crawl Stats via API.

The only supported methods are webmasters.urlcrawlerrorscounts.query, webmasters.urlcrawlerrorssamples.list, webmasters.urlcrawlerrorssamples.get, webmasters.urlcrawlerrorssamples.markAsFixed ( https://developers.google.com/apis-explorer/#p/webmasters/v3/ )

So you can get information about crawl errors, but not general crawl stats.




回答2:


The crawl errors you can retrieve with this API call :

https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.mywebsite.com/urlCrawlErrorsCounts/query?latestCountsOnly=true&fields=countPerTypes&key={YOUR_API_KEY}

But the crawl statistics are not exposed through API.



来源:https://stackoverflow.com/questions/33957888/how-to-get-crawl-stats-from-webmaster-tools-api

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