IWebmasterApi.GetChildrenUrlInfo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get index details for directory
public:
System::Collections::Generic::List<Microsoft::Bing::Webmaster::Api::Interfaces::UrlInfo ^> ^ GetChildrenUrlInfo(System::String ^ siteUrl, System::String ^ url, System::UInt16 page, Microsoft::Bing::Webmaster::Api::Interfaces::FilterProperties ^ filterProperties);
[System.ServiceModel.FaultContract(typeof(Microsoft.Bing.Webmaster.Api.Interfaces.ApiFault))]
[System.ServiceModel.OperationContract]
[System.ServiceModel.Web.WebInvoke(BodyStyle=System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest, Method="POST")]
public System.Collections.Generic.List<Microsoft.Bing.Webmaster.Api.Interfaces.UrlInfo> GetChildrenUrlInfo (string siteUrl, string url, ushort page, Microsoft.Bing.Webmaster.Api.Interfaces.FilterProperties filterProperties);
abstract member GetChildrenUrlInfo : string * string * uint16 * Microsoft.Bing.Webmaster.Api.Interfaces.FilterProperties -> System.Collections.Generic.List<Microsoft.Bing.Webmaster.Api.Interfaces.UrlInfo>
Parameters
- siteUrl
- String
- url
- String
- page
- UInt16
- filterProperties
- FilterProperties
Returns
- Attributes
Examples
This example shows how to display AnchorCount field for all pages/directories in example.com directory.
var containerInfo = api.GetUrlInfo("http://example.com/", "example.com");
if(!containerInfo.IsPage && containerInfo.TotalChildUrlCount > 0)
{
List<Api.UrlInfo> values;
ushort page = 0;
do
{
values = api.GetChildrenUrlInfo("http://example.com/", containerInfo.Url, page, new FilterProperties());
foreach (var urlInfo in values)
{
Console.WriteLine("Url: {0} AnchorCount: {1}", urlInfo.Url, urlInfo.AnchorCount);
}
++page;
} while (values.Count > 0);
}
XML request sample
POST /webmaster/api.svc/pox/GetChildrenUrlInfo?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/xml; charset=utf-8
Host: ssl.bing.com
<GetChildrenUrlInfo xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api">
<siteUrl>http://example.com</siteUrl>
<url>example.com</url>
<page>0</page>
<filterProperties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CrawlDateFilter>LastWeek</a:CrawlDateFilter>
<a:DiscoveredDateFilter>Any</a:DiscoveredDateFilter>
<a:DocFlagsFilters>Any</a:DocFlagsFilters>
<a:HttpCodeFilters>Any</a:HttpCodeFilters>
</filterProperties>
</GetChildrenUrlInfo>
XML response sample
HTTP/1.1 200 OK
Content-Length: 476
Content-Type: application/xml; charset=utf-8
<ArrayOfUrlInfo xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<UrlInfo>
<AnchorCount>50</AnchorCount>
<DiscoveryDate>2011-09-06T16:02:02.37-07:00</DiscoveryDate>
<DocumentSize>0</DocumentSize>
<HttpStatus>0</HttpStatus>
<IsPage>false</IsPage>
<LastCrawledDate>2011-09-16T16:02:02.37-07:00</LastCrawledDate>
<TotalChildUrlCount>100</TotalChildUrlCount>
<Url>example.com</Url>
</UrlInfo>
</ArrayOfUrlInfo>
JSON request sample
POST /webmaster/api.svc/json/GetChildrenUrlInfo?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ssl.bing.com
{
"siteUrl":"http://example.com",
"url":"example.com",
"page":0,
"filterProperties":
{
"__type":"FilterProperties:#Microsoft.Bing.Webmaster.Api",
"CrawlDateFilter":1,
"DiscoveredDateFilter":0,
"DocFlagsFilters":0,
"HttpCodeFilters":0
}
}
JSON response sample
HTTP/1.1 200 OK
Content-Length: 263
Content-Type: application/json; charset=utf-8
{
"d":[
{
"__type":"UrlInfo:#Microsoft.Bing.Webmaster.Api",
"AnchorCount":50,
"DiscoveryDate":"/Date(1315349995284-0700)/",
"DocumentSize":0,
"HttpStatus":0,
"IsPage":false,
"LastCrawledDate":"/Date(1316213995284-0700)/",
"TotalChildUrlCount":100,
"Url":"example.com"
}]
}
Remarks
"domain:" prefix can be used to get information for domain. For example: domain:bing.com