As part of our commitment to the online community through Project Silk Road, we want to make it easy for you to use our API in a way that works best for your needs. The new interfaces exposed by version 2.0 of Live Search API make it very simple to consume results in a variety of environments.
For the near future we plan to use this blog to release reusable code snippets in a variety of environments and languages.
Let’s start with a widely used web programming technology, PHP. From PHP the most straightforward way to call the Live Search API Version 2.0 is to use the API’s JSON interface.
This code snippet shows how to build a basic PHP page that uses the JSON interface to get web search results by using the file_get_contents function to call the interface, and the json_decode function to turn the results into an object that can be processed. In this sample, we use PHP and JSON to send a request to the API’s Web SourceType, but the concept in the sample can be used in any other SourceType or any combination.
PHP and XML
Note: While we have, to this point, focused these samples on Microsoft technology, we are aware that a large number of websites are based on the Linux/Apache/MySQL/PHP (LAMP) stack. While it is very straightforward to use version 2.0 of the API from PHP, a bug in the SOAP extension of PHP in version 5.2.6 and subsequent versions prevented the Live Search API Version 1.1b’s SOAP from being used by a PHP client. This issue has been addressed in Version PHP 5.3.
-- Alessandro
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Live Search API 2.0 through PHP</title></head><body><?php
read more...
If you've been wondering what was simmering in the Live Search API pot these past months, wonder no more! Today we officially launched our beta for the new generation of search engine API.
Live Search API version 2.0 beta, announced this morning at PubCon in Las Vegas, is now just a click away from being live in your development environment.
There's a lot that’s new in this version:
We now offer access through new interfaces: JSON, and XML over HTTP. Of course, you can still use our SOAP interface. But now you have options.
You said you were spinning cycles parsing out non-web results that had been shoehorned into a one-size-fits-all response structure, and we heard you. The new API is strongly typed and offers access to seven different types of results (web, news, images, phonebook, spell-checker, related queries, and Encarta instant answer).
We’ve opened up our Terms of Use, eliminating the pre-set usage quota. We do require that you use this API for user-facing applications only. But that’s reasonable, right?
We’ve retained the popular capability to batch as many SourceTypes as you want into a single request with a single query string.
Exciting? What if I told you that you can apply for a pilot program that will allow you to incorporate advertisements seamlessly into your results pages, retrieving them as one more SourceType in a request? Well, you can!
To top it off, we’ve restructured our RSS interface. Now we offer the ability to use a 100% OpenSearch compliant RSS format to send requests to our web, news, images and phonebook SourceTypes.
Live Search API, version 2.0 beta is what you need to develop search applications that transcend the old-school ten-blue-results-on-a-page.
To get started, g
read more...
For large web sites with extensive amounts of content, 2 to 10 percent of traffic is looking for pages that either don’t exist or have been moved. Most web servers return a generic 404 error page or a sitemap when a user’s desired page cannot be found. These unhelpful pages often result in a dead end for users.
With Microsoft’s Web Page Error Toolkit, you can create dynamic 404 pages that contain customized error messages along with search results seeded with relevant keywords to help your users move past the missing page and find the information they need.
The Toolkit is a customizable ASP.net application that replaces the default error page on your IIS server. The Toolkit enables you to use Live Search (or any search engine) to return results for the specified domain and locale, control the number of results returned on your page, choose whether to offer spelling corrections, and customize your error message.
You also have the option of choosing from several keyword extraction strategies that are included with the install, or providing your own implementation.
Get the Toolkit
To install the Toolkit, click WebPageErrorToolkitSetup.msi.
Before you install, review the API terms of service at Windows Live Platform and Services - Terms of Service.
read more...
The Live Search Interactive SDK now includes code samples for VB.net, in addition to C# and SOAP. The Interactive SDK provides a quick look at the Live Search APIs in action.
To use the Interactive SDK, go to http://dev.live.com/livesearch/sdk/ and get started.
read more...