Wednesday, February 15, 2012

How to return search result in XML?

What does comes to your mind when you have to search something on Internet – Google, Yahoo, Bing, AOL etc. The contributions of these search giants are tremendous in our personal or professional life. It is easy to go and type your search keywords and find the information you are looking after. There is all kind of information available on internet; it is just how smartly you can search it.

In one of the project recently, I had a requirement to return the search result in XML. I have never tried this with Google, Yahoo, Bing, AOL etc. I tried to search for the internet and I concluded with following information’s, which I think can be beneficial for all of us who ever has such requirement.

Google:

I spend some time to find out with Google. Google does allow you to return search result in XML. Google Web Search services allow you to return search result in XML. It is just that you have to pay some yearly fee. I came across some post where it was stated that you have to pay yearly fee of $100 to get this facility from Google. You can check their Google Custom Search APIs and Tools

Yahoo:

I also spend some time to find out with Yahoo. I could not find any relevant information from Yahoo Developer Network (YDN). If I ever come across anything in this context from Yahoo; I will update this section.

Bing:

My search with Bing returns me the right information, I was looking for. With Bing you can return the search result in XML for free.

Here are the steps you need to take to return search result in XML.

Step 1: To return the search result in XML, you have to first of all identify yourself. You need to create an Application ID for yourself. You need to navigate to following URL to connect with Bing Developer.

http://www.bing.com/toolbox/bingdeveloper/

Step 2: You need to click on Create you AppId link. This will take you to the Bing Application API Dashboard. You need to click on Add button to create your application profile. You basically tell to the Bing that what is your source type(ex: web) and return type format(ex: XML SOAP, JSON etc) .

Once you submit the details; you will get an Application ID. An application Id is an alpha numeric string character. In my case, I got a 40 characters length Application Id.

Once you have the Application ID; you are all set. You simply need to navigate to the following URL in the correct format to return the search result in XML.

http://api.search.live.net/xml.aspx?Appid=&query=&sources=

I tried to search for Google browser Chrome with my Application ID and got the following.

The next thing, I did was to compare the XML result with normal result. I went to Bing and search for Chrome to find out.

The normal search result and XML search results were identical.

I hope you enjoy reading the post. Thanks

Popular Posts

Real Time Web Analytics