Yahoo Web Search Api

13
Yahoo Web Search Yahoo Web Search Services Services An Overview An Overview

description

 

Transcript of Yahoo Web Search Api

Page 1: Yahoo Web Search Api

Yahoo Web Search Yahoo Web Search ServicesServices

An OverviewAn Overview

Page 2: Yahoo Web Search Api

Introduction

• What are Yahoo! Web Services?• What do I need to access Yahoo! APIs?• How Do I Get Started?• What are Web Search Services?• Demonstration

Page 3: Yahoo Web Search Api

What are Yahoo Web Services?

Web Services are a way for application developers to access content and services to build new applications. For example, you can combine

Yahoo data and services with those you create in a desktop application or those offered by other Web sites. With Yahoo! Web Services, more

of the power of the Yahoo! network is in your hands.

Page 4: Yahoo Web Search Api

What do I need to access Yahoo API's ?

To access Yahoo! Web Services, Yahoo requires that you register and use an application ID: appid=7CxOsprV34EBlXy5s4LmbibohP3MklF2VORahls9nMBml_pP5uYJ_hlHbVFB7q0Nwhich is tied to your application. Your application ID must be sent with each Web Services request.

Your application also must also follow their Usage Policy and include attribution:

To include this horizontally aligned image in your web site, add the following code:<a href="http://developer.yahoo.com/"><img src="http://l.yimg.com/us.yimg.com/i/us/nt/bdg/websrv_120_1.gif" border="0"></a>

Page 5: Yahoo Web Search Api

How do i get started ?

1. Read the online documentation and FAQs. 2. Get an Application ID. To access Web Search APIs from Yahoo! Search web services, you will need to get an application ID. Like a browser's User-Agent string, the Application ID uniquely identifies your application and has no effect on rate limiting. 3. Download the SDK. The development kit includes BSD licensed examples and libraries for various languages: Perl, Python and PHP, Java, JavaScript, and Flash.

Page 6: Yahoo Web Search Api

What are Web Search Services?

Yahoo! Search Web Services operate via HTTP requests just like your web browser.

Requests are formed by starting with a service entrypoint URL (such as http://search.yahooapis.com/WebSearchService/V1/webSearch for web search queries) and adding query arguments to specify the search results desired (such as ?query=Madonna).

The results returned by the service are in XML which varies per service. Your programs can use these services by submitting a request, fetching the response, and parsing the returned XML to extract the information you need.

Alternately, you may use the provided SDK APIs to handle the protocol specifics for you. Each service accepts a different set of query arguments and produces differently structured XML responses. See the service documentation for the specifics on each.

Page 7: Yahoo Web Search Api

What are Web Search Services?

You can write applications with Yahoo! Search Web Services using data from: * BOSS * Audio Search * Content Analysis * Image Search * Local Search * MyWeb * News Search * Site Explorer * Video Search * Web Search

Page 8: Yahoo Web Search Api

What are Web Search Services?Overview - Web Search Service * Context Search

* Related Suggestion

* Spelling Suggestion

* Web Search

Page 9: Yahoo Web Search Api

What are Web Search Services?* Context Search The Contextual Web Search service returns web pages matching a context-based query, helping you make your searches more powerful. Sample Request URL:http://search.yahooapis.com/WebSearchService/V1/contextSearch<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:srch" xsi:schemaLocation="urn:yahoo:srch http://search.yahooapis.com/WebSearchService/V1/WebSearchResponse.xsd" totalResultsAvailable="3610652" totalResultsReturned="1" firstResultPosition="1"><Result> <Title>United Press International: Putting faces on Jesus and Virgin Mary</Title> <Summary>UPI Perspectives. Putting faces on Jesus and Virgin Mary. By FREDERICK M. WINSHIP. Published 9/16/2002 11:15 AM. NEW YORK, Sept. ... on an ebony cross by Giambologna, considered the greatest 16th century Italian sculptors in the Mannerist style ... whose "Profile of a Young Madonna," a low relief portrait in stone ...</Summary> <Url>http://www.upi.com/view.cfm?StoryID=20020916-105519-8545r</Url> <ClickUrl>http://rds.yahoo.com/S=96857362/K=madonna/v=2/XP=yws/SID=w/l=WS1/R=2/H=0/IPC=us/SHE=0/SIG=12dgic8rc/EXP=1110911915/*-http%3A//www.upi.com/view.cfm?StoryID=20020916-105519-8545r</ClickUrl> <ModificationDate>1108972800</ModificationDate> <MimeType>text/html</MimeType> </Result></ResultSet>

Response:

Page 10: Yahoo Web Search Api

What are Web Search Services?* Related Suggestion The Related Suggestion service returns suggested queries to extend the power of a submitted query, providing variations on a theme to help you dig deeper. Sample Request URL:http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=YahooDemo&query=Madonna

<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:srch" xsi:schemaLocation="urn:yahoo:srch http://search.yahooapis.com/WebSearchService/V1/WebSearchRelatedResponse.xsd"> <Result>Madonna lyrics</Result> <Result>Madonna pictures</Result> </ResultSet>

Response:

Page 11: Yahoo Web Search Api

What are Web Search Services?* Spelling Suggestion The Spelling Suggestion service returns suggested spelling for a given term. Sample Request URL:http://search.yahooapis.com/WebSearchService/V1/spellingSuggestion?appid=YahooDemo&query=madnna

<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:srch" xsi:schemaLocation="urn:yahoo:srch http://search.yahooapis.com/WebSearchService/V1/WebSearchSpellingResponse.xsd"> <Result>Madonna</Result> </ResultSet>

Response:

Page 12: Yahoo Web Search Api

What are Web Search Services?* Web Search The Web Search service allows you to search the Internet for web pages by submitting queries via REST(stands for Representational State Transfer. Most of the Yahoo! Web Services use "REST-Like" RPC-style operations over HTTP GET or POST requests with parameters URL encoded into the request) Sample Request URL:http://search.yahooapis.com/WebSearchService/V1/webSearch<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:srch" xsi:schemaLocation="urn:yahoo:srch http://search.yahooapis.com/WebSearchService/V1/WebSearchResponse.xsd" totalResultsAvailable="3610652" totalResultsReturned="2" firstResultPosition="1"> <Result> <Title>Madonna</Title> <Summary>official site, with news, music, media, and fan club. Includes information on Madonna's 2004 Re-Invention tour.</Summary> <Url>http://www.madonna.com/</Url> <ClickUrl>http://rds.yahoo.com/S=2766679/K=madonna/v=2/XP=yws/SID=e/l=WS1/R=1/SS=33338411/H=1/IPC=us/SHE=0/SIG=11b8pqr3e/EXP=1106183712/*-http%3A//www.madonna.com/</ClickUrl> </Result> <Result> <Title>MTV.com: Madonna</Title> <Summary>Madonna profile page, featuring news, video and audio, photo gallery, and biography.</Summary> <Url>http://www.mtv.com/bands/az/madonna/artist.jhtml</Url> <ClickUrl>http://rds.yahoo.com/S=2766679/K=madonna/v=2/XP=yws/SID=e/l=WS1/R=2/SS=96305700/H=1/IPC=us/SHE=0/SIG=124gl5nub/EXP=1106183712/*-http%3A//www.mtv.com/bands/az/madonna/artist.jhtml</ClickUrl> </Result></ResultSet>

Response:

Page 13: Yahoo Web Search Api

DemonstrationDemonstration