Share via


IWebmasterApi.GetQueryTrafficStats(String, String) Method

Definition

Get detailed traffic statistics for top queries

public:
 System::Collections::Generic::List<Microsoft::Bing::Webmaster::Api::Interfaces::RankAndTrafficStats ^> ^ GetQueryTrafficStats(System::String ^ siteUrl, System::String ^ query);
[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.RankAndTrafficStats> GetQueryTrafficStats (string siteUrl, string query);
abstract member GetQueryTrafficStats : string * string -> System.Collections.Generic.List<Microsoft.Bing.Webmaster.Api.Interfaces.RankAndTrafficStats>
Public Function GetQueryTrafficStats (siteUrl As String, query As String) As List(Of RankAndTrafficStats)

Parameters

siteUrl
String
query
String

Returns

Attributes

Examples

XML request sample

GET /webmaster/api.svc/pox/GetQueryTrafficStats?siteUrl=http://example.com&query=query1&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: 316
Content-Type: application/xml; charset=utf-8

<ArrayOfRankAndTrafficStats xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<RankAndTrafficStats>
<Clicks>15</Clicks>
<Date>2011-09-16T00:00:00-07:00</Date>
<Impressions>100</Impressions>
</RankAndTrafficStats>
</ArrayOfRankAndTrafficStats>

JSON request sample

GET /webmaster/api.svc/json/GetQueryTrafficStats?siteUrl=http://example.com&query=%22query1%22&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: 138
Content-Type: application/json; charset=utf-8


{
"d":[
{
"__type":"RankAndTrafficStats:#Microsoft.Bing.Webmaster.Api",
"Clicks":15,
"Date":"/Date(1316156400000-0700)/",
"Impressions":100
}]
}

Remarks

The data will be updated every day. Only top-queries will be saved and returned by this method.

Applies to