google-api-webmasters

How to get crawl stats FROM webmaster tools api


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.


Solution

  • 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.