Introduction to the Live Search API Have you ever wanted to implement search capabilities on your own Web site but didn’t want to implement the logic and deal with issues such as storage and indexing? The Live Search team now offers two different ways to utilize Search on your site: using the Live Search Box or using the Windows Live Search API. If you aren’t familiar with Live Search, it is located at http://www.live.com. Figure 1 shows the Live Search home page. In addition to a standard search service, Live Search offers searches in various categories such as images, news, maps, and more.  Figure 1: The Live Search home page.The Live Search Box allows a user to harness the power of Live Search without writing any code. It provides a fast, customizable search for any Web site. You can find details on how to get started with this option at http://search.live.com/siteowner. From this site, follow the wizard and copy the HTML code provided into your site. | " | The Live Search team now offers two different ways to utilize Search on your site: using the Live Search Box or Windows Live Search API.
| " |
This article focuses on the Live Search Web Service and how it allows developers to create applications that return results from the Live Search Engine. Live Search Web Service The Live Search Web Service is an Extensible Markup Language (XML) service with a Simple Object Access Protocol (SOAP) API that allows users to create a custom search engine that can query for Web results, images, news, phonebook listings, feeds, and meta tags. You should use this service when you are a developer who is comfortable consuming Web Services and you want more programmatic control over what you are searching for and how you want to display your results. | " | Checking the spelling of a user’s search criteria before performing a search is a great way to improve the usability of your system.
| " |
You can find the fully documented online SDK at http://msdn2.microsoft.com/en-us/library/bb251794.aspx. The documentation describes the requirements, class libraries for the Live Search Web Service, and the terms of use and contains sample code demonstrating use of the Live Search Web Service. Before You Start One of the benefits of using the Live Search Web Service is that the terms of use allow for up to 25,000 queries a day for use in both commercial and non-commercial sites at no cost. The full business terms are located at http://dev.live.com. The first thing you require when using the API is an Application ID. You can register and manage your Live Search Application IDs at the Live Search Developer Center located at http://dev.live.com/search. Figure 2 shows the Developer Center home page.  Figure 2: The Developer Center home page.Once here, you may download the SDK or Create and Manage Application IDs. When creating a new Application ID, give your application a name and make note of the assigned Application ID as you will need to use it in your source code. Figure 3 shows the Get Application ID page.  Figure 3: Developer Center page to get an Application ID.Referencing the Web Service Once you have obtained your Application ID, you need to configure your application to consume the Live Search Web Service. In Visual Studio, add a Web Reference to the WSDL located at http://soap.search.msn.com/webservices.asmx?wsdl. Figure 4 shows the Add Web Reference dialog box with the Live Search Web Service. Once the application has located the Web Service, enter a name for the service and click Add Reference. For all code examples, I have used LiveSearch as the service name.  Figure 4: The Add Web Reference dialog box. | & | | 
By: Bronwen Zande
Bronwen Zande is a Director of Soul Solutions, based in Brisbane, Australia.
With over 10 years of software development experience, Bronwen’s primary focus is Microsoft Live and .NET development. She is a Windows Live Services MVP and part of the core team that runs the ViaWindowsLive.com community site for Windows Live technologies.
When not working with Windows Live, Bronwen helps bring together “GeekGirls” from around the globe at http://www.geekgirlblogs.com.
bronwen@soulsolutions.com.au | Fast Facts | | Live Search Web Service allows for up to 25,000 queries a day for use in both commercial and non-commercial sites at no cost. | |
|