<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Live Search</title><subtitle type="html" /><id>http://dev.live.com/blogs/livesearch/atom.aspx</id><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/default.aspx" /><link rel="self" type="application/atom+xml" href="http://dev.live.com/blogs/livesearch/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2008-11-13T09:21:00Z</updated><entry><title>Bing!</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/05/28/494.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/05/28/494.aspx</id><published>2009-05-28T15:58:00Z</published><updated>2009-05-28T15:58:00Z</updated><content type="html">&lt;p&gt;Today, we are proud and happy to unveil to our developer community our new search brand, Bing. Bing is a powerful new Decision Engine designed to help consumers accomplish tasks and make faster, more informed decisions. For more details on Bing, check out the &lt;a href="http://blogs.msdn.com/livesearch/archive/2009/05/28/the-sound-of-found-bing.aspx"&gt;main Bing blog&lt;/a&gt;. Bing.com will be available to the world in the coming days; in the meantime visit &lt;a href="http://www.decisionengine.com"&gt;http://www.decisionengine.com&lt;/a&gt; and follow us on Twitter (@Bing) for all the latest news. &lt;/p&gt;

&lt;p&gt;So what does this mean to you? The API provides developers programmatic access to Bing, offering flexible options for building or enhancing your site or applications. You can learn more about the API &lt;a href="http://search.live.com/developers"&gt;here&lt;/a&gt;. And try your hand developing new search apps and saving money, the planet, or both in our &lt;a href="http://willcodeforgreen.gnomedex.com/"&gt;Will Code for Green contest&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;A couple of important notes: &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;All applications that worked yesterday will work today with no changes required &lt;/li&gt;

  &lt;li&gt;All use of the Bing API will have to reflect brand attribution by August 30&lt;sup&gt;th&lt;/sup&gt;, 2009. If you are interested in using the API, please familiarize yourself with the &lt;a href="http://www.live.com/developers/tou.aspx"&gt;amended terms of use&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;-- Alessandro Catorcini, Lead Program Manager, Bing API&lt;/p&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=494" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>How to implement search of RSS feeds</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/05/14/492.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/05/14/492.aspx</id><published>2009-05-14T18:32:00Z</published><updated>2009-05-14T18:32:00Z</updated><content type="html">&lt;p&gt;We have observed that it is a very frequent need to restrict a search to RSS feeds. This is possible on the Live.com homepage by using the &lt;b&gt;feed:&lt;/b&gt; keyword in your query. &lt;/p&gt;  &lt;p&gt;While using this operator in an API query does not work, you can achieve the same result by specifying &lt;strong&gt;web.filetype=feed&lt;/strong&gt; as a parameter in the request.&lt;/p&gt;...(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/05/14/492.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=492" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Basics for Green</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/05/01/490.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/05/01/490.aspx</id><published>2009-05-01T18:40:00Z</published><updated>2009-05-01T18:40:00Z</updated><content type="html">A while back, we published a whitepaper on MSDN that provides what we called a "tour de ease" of some basic API features. Subsequently, some of you have requested that we offer this useful doc in a more portable format, so - voila! It's done and downloadable at our Developer Center from the API Basics link, under "Useful Resources." Click it, download it, develop an app or two with it. ...(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/05/01/490.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=490" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Coding for Green</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/04/27/489.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/04/27/489.aspx</id><published>2009-04-27T19:09:00Z</published><updated>2009-04-27T19:09:00Z</updated><content type="html">The Live Search team has announced a contest that enables you to compete with other developers for thousands of dollars in prizes. The idea: Use the Live Search API to create apps that either (1) Help people deal with the worsening economy, or (2) Improve the ecology of the planet.    For details, see Will You Code for Green This Spring?  
Good luck!
-- The Live Search API Team...(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/04/27/489.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=489" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Silk Road Power Trio: New API features, Microsoft Translator, PowerToys CodePlex Launch</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/03/24/483.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/03/24/483.aspx</id><published>2009-03-24T20:24:00Z</published><updated>2009-03-24T20:24:00Z</updated><content type="html">&lt;P&gt;It's spring in the northern hemisphere, and the Live Search API team is celebrating with features that grow the API and the services you can use it to provide. Our SDK was ahead of the curve: It went live with new documentation and code samples on &lt;A href="http://msdn.microsoft.com/en-us/library/aa905676.aspx"&gt;MSDN&lt;/A&gt; and &lt;A href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=0f513086-078b-47a8-a889-842dc93a69ab"&gt;our download center&lt;/A&gt; last week. Whether you're getting hotter in the north or getting colder in the south, we've got new features to make your search applications better all around.&lt;/P&gt;
&lt;P&gt;We debuted all the new features last week at MIX09 - for more on the goings-on there, see the &lt;A href="http://blogs.msdn.com/livesearch/"&gt;Live Search blog&lt;/A&gt;. In this post, you'll find an overview of the new API features&lt;/A&gt;, plus a shout out to a new member of the Live Search team, Microsoft Translator, and a look at the first Live Search API PowerToys codeplex.&lt;/P&gt;
&lt;H2&gt;New API features&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd560940.aspx"&gt;Video - public at last!&lt;/A&gt;&lt;/STRONG&gt; &lt;BR&gt;After determined negotiations, we've achieved sufficient symbiosis with content providers to make the &lt;A href="http://msdn.microsoft.com/en-us/library/dd560940.aspx"&gt;&lt;STRONG&gt;Video&lt;/STRONG&gt; SourceType&lt;/A&gt; available to you with minimal restriction. You'll be able to access &lt;A href="http://msdn.microsoft.com/en-us/library/dd560940.aspx"&gt;&lt;STRONG&gt;Video&lt;/STRONG&gt;&lt;/A&gt; the same as you would &lt;A href="http://msdn.microsoft.com/en-us/library/dd250942.aspx"&gt;&lt;STRONG&gt;Image&lt;/STRONG&gt;&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/en-us/library/dd250845.aspx"&gt;&lt;STRONG&gt;Web&lt;/STRONG&gt;&lt;/A&gt;, and the rest of our burgeoning crop of &lt;A href="http://msdn.microsoft.com/en-us/library/dd250847.aspx"&gt;SourceTypes&lt;/A&gt;. 
&lt;LI&gt;&lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd560912.aspx"&gt;MobileWeb - you asked for it.&lt;/A&gt;&lt;/STRONG&gt; &lt;BR&gt;The second new SourceType of the spring is &lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd560912.aspx"&gt;MobileWeb&lt;/A&gt;&lt;/STRONG&gt;, which returns results from the increasingly growing resource of Extensible Hypertext Markup Language (XHTML), Wireless Markup Language (WML) and other mobile Web pages. Functionally, this highly-demanded SourceType gives you everything you get from the &lt;A href="http://msdn.microsoft.com/en-us/library/dd250845.aspx"&gt;&lt;STRONG&gt;Web&lt;/STRONG&gt; SourceType&lt;/A&gt;, its static sibling - but with content from the mobile world. 
&lt;LI&gt;&lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd560913.aspx"&gt;Image Filters&lt;/A&gt;&lt;/STRONG&gt; &lt;BR&gt;Many developers have told us that they would benefit from a means of restricting &lt;A href="http://msdn.microsoft.com/en-us/library/dd250942.aspx"&gt;&lt;STRONG&gt;Image&lt;/STRONG&gt; SourceType&lt;/A&gt; results to those that have specific characteristics - for example, size, aspect, or style. The &lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd560913.aspx"&gt;ImageRequest.Filters Property&lt;/A&gt;&lt;/STRONG&gt; enables you to use these and more to get exactly the kind of images you want; the new &lt;A href="http://msdn.microsoft.com/en-us/library/dd560940.aspx"&gt;&lt;STRONG&gt;Video&lt;/STRONG&gt; SourceType&lt;/A&gt; has an analagous &lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd560956.aspx"&gt;VideoRequest.Filters Property&lt;/A&gt;&lt;/STRONG&gt;. &lt;/LI&gt;&lt;/UL&gt;
&lt;H2&gt;Microsoft Translator&lt;/H2&gt;
&lt;P&gt;We're happy to give a shout out to the &lt;A href="http://microsofttranslator.com/"&gt;Microsoft Translator&lt;/A&gt; team, which showed off &lt;A href="http://www.microsofttranslator.com/mix09/"&gt;great new features at MIX&lt;/A&gt;, such as:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A href="http://go.microsoft.com/?linkid=9656123"&gt;Microsoft Translator web page widget&lt;/A&gt;&lt;/STRONG&gt; &lt;BR&gt;The Microsoft Translator web page widget allows you to bring real-time, in-place translations to your web site. Users can see your pages in their own language, without having to go to a separate translation web site, and share your page with friends in multiple languages. You can learn more about how to use the widget, get help or interact with other website owners on the Microsoft Translator forums. 2 
&lt;LI&gt;&lt;STRONG&gt;&lt;A href="http://go.microsoft.com/?linkid=9656167"&gt;Microsoft Translator AJAX API&lt;/A&gt;&lt;/STRONG&gt; &lt;BR&gt;The Microsoft Translator AJAX API allows you to easily integrate translation functionality into your web applications and sites. You can learn more about the API on MSDN, try out the interactive SDK or interact with other developers on the Microsoft Translator forums. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;For more information, check out the &lt;A href="http://go.microsoft.com/?linkid=9656026"&gt;Translator team's blog&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;PowerToys Codeplex&lt;/H2&gt;
&lt;P&gt;And, completing this Equinox treasure trio, a PowerToy* for the Live Search API. This PowerToy consists of sample code that demonstrates the ease with which a developer can create a control that takes advantage of Live Search API capabilities, as well as the ease with which such a control can be deployed on a page.&lt;/P&gt;
&lt;P&gt;You can see an example of such a control in the &lt;STRONG&gt;Washington on the Web&lt;/STRONG&gt; section in the lower right of this &lt;A href="http://ezfshn.com/FishingLocations/USA/NorthWest/washington.aspx"&gt;outdoor-recreation-website-in-progress&lt;/A&gt;. The control plays a slideshow based on images returned from a query sent to the API's &lt;A href="http://msdn.microsoft.com/en-us/library/dd250942.aspx"&gt;&lt;STRONG&gt;Image&lt;/STRONG&gt; SourceType &lt;/A&gt;. The control is written in C#, and the aspx page can be set up at design time to use the &lt;A href="http://msdn.microsoft.com/en-us/library/dd560913.aspx"&gt;&lt;STRONG&gt;ImageRequest.Filters Property&lt;/STRONG&gt;&lt;/A&gt; to filter the images based on query term, size, color and style.&lt;/P&gt;
&lt;P&gt;To get started, download the sample code from &lt;A href="http://silkroad.codeplex.com/SourceControl/ListDownloadableCommits.aspx"&gt;Silk Road PowerToys&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#3a5152&gt;* PowerToys are &lt;/FONT&gt;Microsoft product productivity tools developed after a release. They are not an official part of the product and are not supported by Microsoft.&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;Happy Equinox and Happy Developing - The Live Search API Team&lt;/P&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=483" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Using the API with Java: Download Package</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/02/26/476.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/02/26/476.aspx</id><published>2009-02-27T01:40:00Z</published><updated>2009-02-27T01:40:00Z</updated><content type="html">This is the final post in our series that shows how you can use the API with Java. As promised, we've packaged the instructions and code from the first two posts in the series with code and instructions for two new applications and made the package available on &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=053a1755-2d4e-4d22-9179-bebaa7c5484c"&gt;our download site&lt;/a&gt;.  Thus, the package includes code and instructions for creating:  &lt;ul&gt; &lt;li&gt;A console application using Java and the API's XML interface &lt;li&gt;A console application using Java and the API's SOAP interface &lt;li&gt;A search box application using Java, Java Server Pages, and the  API's XML interface &lt;li&gt;A search box application using Java, Servlets, and the  API's SOAP interface&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;-- Roopali Kaujalgi&lt;/p&gt;
&lt;p&gt;Progam Manager, Live Search API team&lt;/p&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=476" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>New Ubiquity commands for Live Search</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/02/24/475.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/02/24/475.aspx</id><published>2009-02-25T01:59:00Z</published><updated>2009-02-25T01:59:00Z</updated><content type="html">&lt;p&gt;Mark Johnson from the Powerset team has posted on the &lt;a href="http://www.powerset.com/blog/articles/2009/02/24/try-our-new-ubiquity-commands-for-powerset-and-live-search"&gt;Powerset blog&lt;/a&gt; regarding Ubiquity  commands for Powerset and highlighted some commands for Live Search as well.   Ubiquity is a research project from Mozilla Labs that has a lot in common with Powerset: the goal of the project is to reinvent the user interface through natural language. Ubiquity uses a command-line interface to allow you to get tasks done quicker by typing in exactly what you want.&lt;/p&gt;&lt;p&gt; Powerset is excited to have written a few Ubiquity commands that you might find useful. Once you have the commands installed, you can just type in "powerset " and you'll get a full Powerset Wikipedia search of the topic you enter. As a bonus, they've also included commands from Live Search. &lt;/p&gt;&lt;p&gt;For example, try typing "live sean penn" to get Live Search results for Sean Penn. You can also type "live images sean penn" to get a list of images or "live xrank sean penn" to get Sean Penn's xRank answer. It was really simple to do this thanks to the Live Search API's JSON interface.&lt;/p&gt;

&lt;p&gt;In case you don’t have Ubiquity and you’re wondering what it's about, here's a &lt;a href="http://vimeo.com/3113274"&gt;brief video&lt;/a&gt; of the Live Ubiquity commands. 

&lt;p&gt; Check out &lt;a href="http://www.powerset.com/blog/articles/2009/02/24/try-our-new-ubiquity-commands-for-powerset-and-live-search"&gt;the post&lt;/a&gt; for more details! &lt;/p&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=475" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Using the Live Search API Version 2.0 Beta with Java and the API's SOAP Interface</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/02/16/472.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/02/16/472.aspx</id><published>2009-02-16T20:55:00Z</published><updated>2009-02-16T20:55:00Z</updated><content type="html">This is the second in a series of posts that show how you can use the API with Java. This post shows how you can use Java to create a console application that sends a request to the API's SOAP interface and displays the results....(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/02/16/472.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=472" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Using the API Version 2.0 Beta with Java and the API's XML interface</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/02/03/468.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/02/03/468.aspx</id><published>2009-02-04T01:57:00Z</published><updated>2009-02-04T01:57:00Z</updated><content type="html">&lt;P&gt;This is the first of a series of posts that show how you can use the API with Java. This post shows how you can use Java to create a console application that sends a request to the API's XML interface and displays the results. The last post in the series will include a pointer to a site&amp;nbsp;from which&amp;nbsp;you can download&amp;nbsp;all instructions and&amp;nbsp;code associated with each post in the series.&lt;/P&gt;
&lt;P&gt;Coming next: Using the API with Java and the SOAP interface&lt;/P&gt;
&lt;P&gt;-- Roopali&lt;/P&gt;
&lt;H2&gt;Requirements&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Java Development Kit (JDK) 1.6 
&lt;LI&gt;Live Search API Version 2.0 AppId (available at&amp;nbsp;&lt;A href="http://search.live.com/developers"&gt;http://search.live.com/developers&lt;/A&gt;)&lt;/LI&gt;&lt;/UL&gt;
&lt;H2&gt;Demonstrates&lt;/H2&gt;
&lt;P&gt;These code samples demonstrates how to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Send a request to the Live Search XML interface and the &lt;STRONG&gt;Web&lt;/STRONG&gt; SourceType 
&lt;LI&gt;Display the Live Search response as results &lt;/LI&gt;&lt;/UL&gt;
&lt;H2&gt;To run the sample&lt;/H2&gt;
&lt;OL&gt;
&lt;LI&gt;Create files named &lt;STRONG&gt;WebSample.java&lt;/STRONG&gt; and &lt;STRONG&gt;APINameSpaceContext.java&lt;/STRONG&gt;. 
&lt;LI&gt;Copy "File 1 Content: WebSample.java" from the section of that name in this post to &lt;STRONG&gt;WebSample.java&lt;/STRONG&gt;. 
&lt;LI&gt;Copy "File 2 Content: APINameSpaceContext.java" from the section of that name in this post to &lt;STRONG&gt;APINameSpaceContext.java&lt;/STRONG&gt;. 
&lt;LI&gt;In &lt;STRONG&gt;WebSample.java&lt;/STRONG&gt;, substitute your AppId for &lt;STRONG&gt;Insert your AppId here&lt;/STRONG&gt;. 
&lt;LI&gt;Edit your computer's &lt;STRONG&gt;PATH&lt;/STRONG&gt; environment variable to include the bin directory of the JAVA installation. 
&lt;LI&gt;Compile the 2 files. 
&lt;LI&gt;Run the sample (for example, typing&amp;nbsp;&lt;STRONG&gt;java&lt;/STRONG&gt; &lt;STRONG&gt;WebSample&lt;/STRONG&gt; from the command line in the directory containing &lt;STRONG&gt;WebSample.java&lt;/STRONG&gt;). &lt;/LI&gt;&lt;/OL&gt;
&lt;H2&gt;File Content&lt;/H2&gt;
&lt;P&gt;The remainder of this post consists of the content (in the form of code) that you will copy in Steps&amp;nbsp;2 and 3 of "To Run the Sample."&lt;/P&gt;
&lt;H4&gt;File 1 Content: WebSample.java&lt;/H4&gt;&lt;PRE class=code&gt;import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

//Live Search API 2.0 code sample demonstrating the use of the
//Web SourceType over the XML Protocol.
class WebSample 
{
	static XPathFactory factory = null;
	static XPath xpath = null;
	static XPathExpression expr = null;

	public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, &lt;BR&gt;XPathExpressionException
	{
		// Build the request.
		String requestURL = BuildRequest();

		// Send the request to the Live Search Service and get the response.
		Document doc = GetResponse(requestURL);

		if(doc != null)
		{
			// Display the response obtained from the Live Search Service.
			DisplayResponse(doc);
		}

	}
	private static String BuildRequest()
	{
		// Replace the following string with the AppId you received from the
		// Live Search Developer Center.
		String AppId = "Insert your AppId here.";
		String requestString = "http://api.search.live.net/xml.aspx?"

			// Common request fields (required)
			+ "AppId=" + AppId
			+ "&amp;amp;Query=msdn blogs"
			+ "&amp;amp;Sources=Web"

			// Common request fields (optional)
			+ "&amp;amp;Version=2.0"
			+ "&amp;amp;Market=en-us"
			+ "&amp;amp;Adult=Moderate"

			// Web-specific request fields (optional)
			+ "&amp;amp;Web.Count=10"
			+ "&amp;amp;Web.Offset=0"
			+ "&amp;amp;Web.FileType=DOC"
			+ "&amp;amp;Web.Options=DisableHostCollapsing+DisableQueryAlterations";

		return requestString;
	}

	private static Document GetResponse(String requestURL) throws ParserConfigurationException, SAXException, 
&lt;BR&gt;IOException 
	{
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		dbf.setNamespaceAware(true);
		Document doc = null;
		DocumentBuilder db = dbf.newDocumentBuilder();

		if (db != null)
		{              
			doc = db.parse(requestURL);
		}

		return doc;
	}

	private static void DisplayResponse(Document doc) throws XPathExpressionException
	{
		factory = XPathFactory.newInstance();
		xpath = factory.newXPath();
		xpath.setNamespaceContext(new APINameSpaceContext());
		NodeList errors = (NodeList) xpath.evaluate("//api:Error",doc,XPathConstants.NODESET);

		if(errors != null &amp;amp;&amp;amp; errors.getLength() &amp;gt; 0 )
		{
			// There are errors in the response. Display error details.
			DisplayErrors(errors);
		}
		else
		{
			DisplayResults(doc);
		}
	}

	private static void DisplayResults(Document doc) throws XPathExpressionException 
	{
		String version = (String)xpath.evaluate("//@Version",doc,XPathConstants.STRING);
		String searchTerms = (String)xpath.evaluate("//api:SearchTerms",doc,XPathConstants.STRING);
		int total = Integer.parseInt((String)xpath.evaluate("//web:Web/web:Total",doc,XPathConstants.STRING));
		int offset = Integer.parseInt((String)xpath.evaluate("//web:Web/web:Offset",doc,
&lt;BR&gt;XPathConstants.STRING));
		NodeList results = (NodeList)xpath.evaluate"//web:Web/web:Results/web:WebResult",doc,
&lt;BR&gt;XPathConstants.NODESET); 

		// Display the results header.
		System.out.println("Live Search API Version " + version);
		System.out.println("Web results for " + searchTerms);
		System.out.println("Displaying " + (offset+1) + " to " + (offset + 
&lt;BR&gt;results.getLength()) + " of " + total + " results ");
		System.out.println();

		// Display the Web results.
		StringBuilder builder = new StringBuilder();

		for(int i = 0 ; i &amp;lt; results.getLength(); i++)
		{
			NodeList childNodes = results.item(i).getChildNodes();

			for (int j = 0; j &amp;lt; childNodes.getLength(); j++) 
			{
				if(!childNodes.item(j).getLocalName().equalsIgnoreCase("DisplayUrl"))
				{
					String fieldName = childNodes.item(j).getLocalName();

					if(fieldName.equalsIgnoreCase("DateTime"))
					{
						fieldName = "Last Crawled";
					}

					builder.append(fieldName + ":" + childNodes.item(j).getTextContent());
					builder.append("\n");
				}
			}

			builder.append("\n");
		}

		System.out.println(builder.toString());
	}

	private static void DisplayErrors(NodeList errors) 
	{
		System.out.println("Live Search API Errors:");
		System.out.println();

		for (int i = 0; i &amp;lt; errors.getLength(); i++) 
		{
			NodeList childNodes = errors.item(i).getChildNodes();

			for (int j = 0; j &amp;lt; childNodes.getLength(); j++) 
			{
				System.out.println(childNodes.item(j).getLocalName() + ":" + childNodes.item(j).getTextContent());
			}

			System.out.println();
		}
	}
}
&lt;/PRE&gt;
&lt;H4&gt;File 2 Content: APINameSpaceContext.java&lt;/H4&gt;&lt;PRE class=code&gt;import java.util.Iterator;

import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;

// Map prefixes to Namespace URIs
public class APINameSpaceContext implements NamespaceContext 
{
	static final String WEB_NAMESPACE =  "http://schemas.microsoft.com/LiveSearch/2008/04/XML/web";
	static final String API_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/element";
	static final String SPELL_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/spell";
	static final String RS_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/relatedsearch";
	static final String PB_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/phonebook";
	static final String MM_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/multimedia";
	static final String AD_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/ads";
	static final String IA_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/instantanswer";
	static final String NEWS_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/news";
	static final String ENCARTA_NAMESPACE = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/encarta";

	public String getNamespaceURI(String prefix) 
	{
		if (prefix == null) throw new NullPointerException("Null prefix");
		else if ("api".equals(prefix)) return API_NAMESPACE;
		else if ("web".equals(prefix)) return WEB_NAMESPACE;
		return XMLConstants.NULL_NS_URI;
	}
	
	// This method isn't necessary for XPath processing.
	public String getPrefix(String uri) 
	{
		throw new UnsupportedOperationException();
	}
	
	public Iterator getPrefixes(String arg0) 
	{
		throw new UnsupportedOperationException();
	}
}&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=468" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>API Basics</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/01/28/459.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/01/28/459.aspx</id><published>2009-01-29T00:00:00Z</published><updated>2009-01-29T00:00:00Z</updated><content type="html">Yesterday we posted Introducing Live Search API Version 2.0 Beta on MSDN. This whitepaper provides a tour de ease through some basic API features......(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/01/28/459.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=459" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Using the API Version 2.0 Beta with ASP+XSL</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/01/22/451.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/01/22/451.aspx</id><published>2009-01-22T23:41:00Z</published><updated>2009-01-22T23:41:00Z</updated><content type="html">An example of good ole ASP+XSL....(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/01/22/451.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=451" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Using the Live Search API Version 2.0 Beta with ASP</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/01/16/448.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/01/16/448.aspx</id><published>2009-01-16T19:38:00Z</published><updated>2009-01-16T19:38:00Z</updated><content type="html">This post demonstrates using the API with good old ASP - plus a little XPATH magic....(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/01/16/448.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=448" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>PHP and XML</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/01/08/445.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/01/08/445.aspx</id><published>2009-01-08T19:00:00Z</published><updated>2009-01-08T19:00:00Z</updated><content type="html">The second in a series of samples demonstrating the use of Live Search API, Version 2.0 Beta with PHP.
...(&lt;a href="http://dev.live.comhttp://dev.live.com/blogs/livesearch/archive/2009/01/08/445.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dev.live.com/aggbug.aspx?PostID=445" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Using the Live Search API Version 2.0 Beta with PHP and JSON</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2009/01/05/444.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2009/01/05/444.aspx</id><published>2009-01-05T17:46:00Z</published><updated>2009-01-05T17:46:00Z</updated><content type="html">&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;For the near future we plan to use this blog to release reusable code snippets in a variety of environments and languages.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;This code snippet shows how to build a basic PHP page that uses the JSON interface to get web search results by using the &lt;b&gt;file_get_contents&lt;/b&gt; function to call the interface, and the &lt;span class="spelle"&gt;&lt;b&gt;json_decode&lt;/b&gt; 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 &lt;b&gt;Web&lt;/b&gt; SourceType, but the concept in the sample can be used in any other SourceType or any combination.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;In the next blog: &lt;/b&gt;PHP and XML&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: 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, &lt;a href="http://bugs.php.net/bug.php?id=43069"&gt;a bug in the SOAP extension of PHP&amp;nbsp; in version 5.2.6 and subsequent versions&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;-- Alessandro&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;html&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;head&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;title&amp;gt;Live Search API 2.0 through PHP&amp;lt;/title&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;/head&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;body&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;?php&lt;br&gt;&lt;br&gt;"Your AppID here";&lt;br&gt;&lt;br&gt;?&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;form "post" action="&amp;lt;?php echo $PHP_SELF;?&amp;gt;"&amp;gt; &lt;br&gt;&lt;br&gt;&amp;lt;input type="text" id="searchBox" name="searchBox" value="&amp;lt;?php &lt;br&gt;&lt;br&gt;if (isset($_POST['searchBox'])){&lt;br&gt;&lt;br&gt;echo($_POST['searchBox']); &lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;else { &lt;br&gt;&lt;br&gt;echo('Microsoft');&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;?&amp;gt;"/&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;input type="submit" value="Search" name="submit" id="searchButton" /&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;?php&lt;br&gt;&lt;br&gt;if (isset($_POST['submit'])) &lt;br&gt;&lt;br&gt;{&lt;br&gt;&lt;br&gt;$request = 'http://api.search.live.net/json.aspx?Appid=' . $APPID . '&amp;amp;sources=web&amp;amp;query=' . urlencode($_POST["searchBox"]);&lt;br&gt;&lt;br&gt;$response = file_get_contents($request);&lt;br&gt;&lt;br&gt;$jsonobj = json_decode($response);&lt;br&gt;&lt;br&gt;echo('&amp;lt;ul ID="resultList"&amp;gt;'); &lt;br&gt;&lt;br&gt;foreach($jsonobj-&amp;gt;SearchResponse-&amp;gt;Web-&amp;gt;Results as $value)&lt;br&gt;&lt;br&gt;{&lt;br&gt;&lt;br&gt;echo('&amp;lt;li class="resultlistitem"&amp;gt;&amp;lt;a href="' . $value-&amp;gt;Url . '"&amp;gt;');&lt;br&gt;&lt;br&gt;echo('&amp;lt;h3&amp;gt;' . $value-&amp;gt;Title . '&amp;lt;/h3&amp;gt;&amp;lt;/a&amp;gt;');&lt;br&gt;&lt;br&gt;echo('&amp;lt;p&amp;gt;' . $value-&amp;gt;Description . '&amp;lt;/p&amp;gt;');&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;echo("&amp;lt;/ul&amp;gt;");&lt;br&gt;&lt;br&gt;} &lt;br&gt;&lt;br&gt;?&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;/form&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;/body&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=444" width="1" height="1"&gt;</content><author><name>ianwh</name><uri>http://dev.live.com/members/ianwh.aspx</uri></author></entry><entry><title>Announcing the new Live Search API, version 2.0 beta!</title><link rel="alternate" type="text/html" href="http://dev.live.com/blogs/livesearch/archive/2008/11/13/433.aspx" /><id>http://dev.live.com/blogs/livesearch/archive/2008/11/13/433.aspx</id><published>2008-11-13T15:21:00Z</published><updated>2008-11-13T15:21:00Z</updated><content type="html">&lt;P&gt;If you've been wondering&amp;nbsp;what was simmering in the Live Search API pot these past months,&amp;nbsp;wonder no more! Today we officially launched&amp;nbsp;our beta&amp;nbsp;for the new generation of search engine API.&lt;/P&gt;
&lt;P&gt;Live Search API version 2.0 beta, &lt;A href="http://blogs.msdn.com/livesearch/archive/2008/11/13/the-next-step-in-search.aspx"&gt;announced this morning&amp;nbsp;at PubCon&lt;/A&gt; in&amp;nbsp;Las Vegas,&amp;nbsp;is now&amp;nbsp;just&amp;nbsp;a click away from being&amp;nbsp;live in your development environment.&lt;/P&gt;
&lt;P&gt;There's a lot that’s new in this version:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;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. 
&lt;LI&gt;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&amp;nbsp;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). 
&lt;LI&gt;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? 
&lt;LI&gt;We’ve retained the popular capability to batch as many SourceTypes as you want into a single request with a single query string.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;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!&lt;/P&gt;
&lt;P&gt;To top it off, we’ve restructured our RSS interface. Now we offer the ability to use a 100% &lt;A href="http://www.opensearch.org/"&gt;OpenSearch&lt;/A&gt; compliant RSS format to send requests to our web, news, images and phonebook SourceTypes.&lt;/P&gt;
&lt;P&gt;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. &lt;/P&gt;
&lt;P&gt;To get started, go to the &lt;A href="http://search.live.com/developers"&gt;Live Search Developer Center&lt;/A&gt; and get your AppID today!&lt;/P&gt;
&lt;P&gt;-Alessandro Catorcini, Lead Program Manager for APIs&lt;/P&gt;&lt;img src="http://dev.live.com/aggbug.aspx?PostID=433" width="1" height="1"&gt;</content><author><name>StephH</name><uri>http://dev.live.com/members/StephH.aspx</uri></author></entry></feed>