Welcome to the navigation

Duis aute fugiat ipsum mollit sint occaecat incididunt pariatur, ea excepteur labore dolore sed deserunt nulla culpa dolor ut in quis commodo nostrud do lorem. Reprehenderit nostrud quis aliqua, dolore ullamco sint ad veniam, et laborum, anim irure proident, cillum exercitation enim qui culpa sunt dolor adipisicing in sit tempor

Yeah, this will be replaced... But please enjoy the search!

Exploring the Bing Webmaster Tools API: Checking if a page is submitted

In case you didnt know Microsoft Bing is a search engine, it also have a similiar toolkit as google does for webmasters to manage and analyze their sites. Most operations are also available over API for automation. In this post I explore how to detect if a page is submitted to the index or not.

Reasons

I'll need to check if a page is submitted to the index or not. It doesn't matter if it was submitted manually, by normal crawling, by sitemap or by API.

Getting started

If you never integrated with the Bing Webmaster API start at http://msdn.microsoft.com/en-us/library/hh969349.

Code

There isn't really any obvious method to use in the IWebmasterApi class and the result are sometimes confusing. The only method that makes sense is the GetUrlInfo method which will return index details for single page.

UrlInfo GetUrlInfo(
	string siteUrl, // the domain url to the site
	string url // the url to the page including the domain url
)

I did set up a small test to figure out what was going on.

var bingApi = new WebmasterApiClient();
var siteUrl = "http://www.herlitz.nu/";

// This should be ok
var info = bingApi.GetUrlInfo(
	siteUrl, 
	string.Concat(siteUrl, "2015/03/12/2tb-sata-hdd-in-sas-bay")
);

// This should fail
var infoFail = bingApi.GetUrlInfo(
	siteUrl,
	string.Concat(siteUrl, "IDontExist")
);

Result

 

Check the field HttpStatus

Cheers!

Please note that this portal is a BETA site , I will continuously improve all functionality and performance during the coming weeks / the author