Share via


IWebmasterApi.GetCrawlStats(String) Method

Definition

Get crawl statistics

public:
 System::Collections::Generic::List<Microsoft::Bing::Webmaster::Api::Interfaces::CrawlStats ^> ^ GetCrawlStats(System::String ^ siteUrl);
[System.ServiceModel.FaultContract(typeof(Microsoft.Bing.Webmaster.Api.Interfaces.ApiFault))]
[System.ServiceModel.OperationContract]
[System.ServiceModel.Web.WebGet(BodyStyle=System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest)]
public System.Collections.Generic.List<Microsoft.Bing.Webmaster.Api.Interfaces.CrawlStats> GetCrawlStats (string siteUrl);
abstract member GetCrawlStats : string -> System.Collections.Generic.List<Microsoft.Bing.Webmaster.Api.Interfaces.CrawlStats>
Public Function GetCrawlStats (siteUrl As String) As List(Of CrawlStats)

Parameters

siteUrl
String

Returns

List of crawl statistics for the last 6 months

Attributes

Examples

XML request sample

GET /webmaster/api.svc/pox/GetCrawlStats?siteUrl=http://example.com&apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/xml; charset=utf-8
Host: ssl.bing.com

XML response sample

HTTP/1.1 200 OK
Content-Length: 548
Content-Type: application/xml; charset=utf-8

<ArrayOfCrawlStats xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CrawlStats>
<AllOtherCodes>0</AllOtherCodes>
<BlockedByRobotsTxt>0</BlockedByRobotsTxt>
<Code2xx>9998</Code2xx>
<Code301>0</Code301>
<Code302>0</Code302>
<Code4xx>1</Code4xx>
<Code5xx>1</Code5xx>
<ContainsMalware>5</ContainsMalware>
<CrawlErrors>0</CrawlErrors>
<CrawledPages>0</CrawledPages>
<Date>2011-09-16T00:00:00-07:00</Date>
<InIndex>1000</InIndex>
<InLinks>2048</InLinks>
</CrawlStats>
</ArrayOfCrawlStats>

JSON request sample

GET /webmaster/api.svc/json/GetCrawlStats?siteUrl=http://example.com&apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ssl.bing.com

JSON response sample

HTTP/1.1 200 OK
Content-Length: 286
Content-Type: application/json; charset=utf-8


{
"d":[
{
"__type":"CrawlStats:#Microsoft.Bing.Webmaster.Api",
"AllOtherCodes":0,
"BlockedByRobotsTxt":0,
"Code2xx":9998,
"Code301":0,
"Code302":0,
"Code4xx":1,
"Code5xx":1,
"ContainsMalware":5,
"CrawlErrors":0,
"CrawledPages":0,
"Date":"/Date(1316156400000-0700)/",
"InIndex":1000,
"InLinks":2048
}]
}

Remarks

The data will be updated every day.

Applies to