Search Me…

Ashish pointed you at the Windows Live Dev center, so I thought I would give you an idea how easy it is to use the web services in your own applications by showing you how to leverage Windows Live Search to provide search functionality on YOUR web site.

You need to start the process by going to and provisioning yourself an “Application ID” which is your unique key to call the web service. It is a very quick process that gives you a string of characters that you need to pass with each call.

Once you have that, calling the search web service is as easy as adding a “web reference” to and dropping in a few lines of code.

For this example, we will call the search service when users click the “Search” button on our ASP .NET web site and then bind the results to a GridView control.

void Search_OnClick(object sender, EventArgs e)


SearchRequest searchRequest = new

searchRequest.AppID = “<insert your unique AppID here>”;

searchRequest.CultureInfo = “en-US”;

searchRequest.Query = string.Format(“{0}”, Textbox1.Text);


SourceRequest webSource = new

webSource.Source = SourceType.Web;

searchRequest.Requests = new
SourceRequest[] { webSource };


MSNSearchService s = new

SearchResponse searchResponse = s.Search(searchRequest);


GridView1.DataSource = searchResponse.Responses[0].Results;



Pretty powerful stuff – dive in and give it a try, maybe on your own console app…

Comments (1)

  1. Tara says:


    When I try to add a web reference to, it promts me for a user name, password and domain.

    What do I do at this point?