Partager via


Create COOL implementations of Search API 2.0 Beta + Ads

In case you haven't seen this -

 

During

the keynote at PubCon in Las Vegas we announced “Project Silk Road” which is a collection of services, including a new version of the Live Search APIs for developer community – basically Search API 2.0 Beta + Search Ads pilot.

 

We are looking for some really cool implementations from the developer community which will be displayed on our website at: https://search.live.com/developers  We’re looking for as many implementations as possible! Come on team, put your developer skills to use and share your passion about Microsoft technology!

 

Win a Prize:

All submissions entered by (12am) midnight PST US on Dec 5th 2008 will be eligible for our prize drawing of a $120 gift certificate to the Microsoft Company store.

Please note: All submissions must be on live websites (so we have to be able to navigate to the website or be able to download the application to see it) and must follow our Terms of Use – present on Search API and Ads web sites respectively. Drawing will take place on Dec 8th 2008 and the winner will be notified via email by Dec 9th 2008. 

Send all links/information about implementations to: AniB@Microsoft.com.

 

GeekswithBlogs.net

Check out one of the first implementations of the Search API 2.0 Beta at https://geekswithblogs.net

Learn more about: Search API 2.0 (Beta) + Ads pilot

The Live Search API 2.0 Beta enables you to embed as a custom component a flexible and powerful search engine on your sites and applications. With the addition of XML (POX) and JSON formats, as well as the previously supported SOAP API, the Live Search API 2.0 Beta allows you to integrate the power of search using the code and formatting you choose. In addition, some source formats types are also accessible through an OpenSearch-compliant RSS interface.

Step 1: Get an App ID

Go to https://search.live.com/developers to create your AppID which you will use to gain access to all the great search results from Search API 2.0.

 

Step 2: Select your URI type

When you want to query the HTTP endpoint you first start with an HTTP GET request to the appropriate URI (Uniform Resource Identifier). There are two URIs, one for XML results and one for JSON results: https://api.search.live.net/xml.aspx and https://api.search.live.net/json.aspx respectively.

Both URIs expect at least three required query string parameters: AppID, query, and sources. The AppID query string parameter is a value you get when you sign up as a developer with the Developer Center program (https://search.live.com/developers). The query value will be the query you want the API to execute for you, and the sources value indicates which Live Search Engine indexes you want the query to be run against. 

 

Step 3: Select your source type

The following are the source types supported by the current release of the Search API 2.0 Beta.

Source

Description

web

Searches for web content

image

Searches for images on the web

news

Searches news stories

instantanswer

Searches Encarta online

spell

Searches Encarta dictionary for spelling suggestions

phonebook

Searches phonebook entries

relatedsearch

Returns the query strings most similar to yours

Step 4: Select your front end

RIA - Silverlight

Silverlight is a framework from Microsoft that enables developers to build Rich Internet Applications (RIAs), using the same .NET framework and programming languages they are familiar with using in their typical .NET applications. Because of its strong integration with browsers, as well as with images and other media, it is a robust and very interesting client for building applications using the Live Search API 2.0 Beta.

Like JSON applications that live in the browser, Silverlight applications can’t normally invoke services (raw HTTP or SOAP) on domains other than the domain where the Silverlight application is downloaded from. But because Live Search API 2.0 beta publishes a crossdomain.xml policy file at the root of its domain, https://api.search.live.net/crossdomain.xml, it allows RIAs to access its endpoints, making it possible to use the Live Search API 2.0 Beta from Silverlight.

 

Interoperable – PHP

Another reason to maintain a more open API using HTTP (and raw XML and JSON) is to enable interoperable scenarios with Live Search API 2.0 Beta. It isn’t just for .NET programmers. For example, PHP has a powerful JSON parsing mechanism, which, given PHP is a dynamic language, enables PHP developers to program against a JSON object graph in a very straightforward way.

 

 

RSS

In additional to the XML/JSON APIs which allow a user to make explicit search requests of the different Live Search sources, these sources are also exposed via a web feed mechanism formatted using Really Simple Syndication (RSS). In addition, the RSS endpoint is open and doesn’t require an App ID. Any user can make a feed request of the API and subscribe to that feed using his favorite feed reader. The feed reader can then take care of maintaining state, and the user will be notified whenever there is new data.

This is the only part of the new Live Search API 2.0 beta that can be used by end users, since it is the only URI that doesn’t require an App ID as part of the query string.

Step 5: If you want to Monetize

Another feature of Live Search 2.0 is ad-serving capability. If you sign up for a Live Search API 2.0 Beta App ID and opt into the adCenter terms of use, and apply for an Ads unit ID thru adCenter as listed on our Developer Center (https://search.live.com/developers) once approved, you can integrate ads into your web pages using simple XML or JSON APIs. Ads are just another content source, so all the information about the other search sources applies to the ad source, although there are a few additional required query string parameters and an additional adCenter Unit ID.

Query String

Description

Ad.AdUnitId

Your adCenter Unit ID

Ad.PropertyId

Your adCenter Property ID

Ad.Pagenumber

The page number requested

Ad.SBadCount

Number of sidebar ads requested

Ad.MLadCount

Number of mainline ads requested

SDK can be found here

Comments