Yahoo News Search

The News Search service allows you to search the Internet for news stories.


Resources

http://api.search.yahoo.com/NewsSearchService/V1/newsSearch

The News Search service is limited to 5,000 queries per IP address per day. See information on rate limiting and our Usage Policy to learn about acceptable uses and how to request additional queries

Sample Request Url: http://api.search.yahoo.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&query=madonna&results=2&language=en

Request
Query Parameters
parameter value description

appid

string (required)

The application ID. See Application IDs for more information.

query

string (required)

The query to search for.

type

string

One of:

  • all (default)
  • any
  • phrase

The kind of search to submit:

  • all returns results with all query terms.
  • any returns results with one or more of the query terms.
  • phrase returns results containing the query terms as a phrase.

results

int

Default: 10

The number of results to return; at most, 50.

start

int

Default: 1

The starting result position to return (1-based). The finishing position (start + results - 1) cannot exceed 1000.

sort

string

One of:

  • rank (default)
  • date

Sort articles by relevance or most-recent.

language

string

The language the results are written in. Supported Languages. Omitting language returns results in any language.

site

string

A domain to restrict your searches to (e.g. www.yahoo.com). You may submit up to 30 values (e.g., site=www.yahoo.com&site=www.cnn.com).

output

string

One of:

  • xml (default)
  • json
  • php

The format for the output. If json is requested, the results will be returned in JSON format. If php is requested, the results will be returned in Serialized PHP format.

callback

string

The name of the callback function to wrap around the JSON data. The following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has not been requested, this parameter has no effect. More information on the callback can be found in the Yahoo! Developer Network JSON Documentation.

Response
Response Representations
  • News Search Result Set (application/xml)
  • Faults
  • 400 - application/xml
  • Representations

    News Search Result Set (application/xml)

    XML Schema

    Source: http://api.search.yahoo.com/NewsSearchService/V1/NewsSearchResponse.xsd

    <xs:element name="ResultSet">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="Result" type="ResultType" minOccurs="0" maxOccurs="50"/>
    			</xs:sequence>
    			<xs:attribute name="totalResultsAvailable" type="xs:integer"/>
    			<xs:attribute name="totalResultsReturned" type="xs:integer"/>
    			<xs:attribute name="firstResultPosition" type="xs:integer"/>
    		</xs:complexType>
    	</xs:element>
    Representation Parameters
    parameter value description

    ResultSet

    Contains all of the query responses. Has attributes:

    • totalResultsAvailable: The number of query matches in the database.
    • totalResultsReturned: The number of query matches returned. This may be lower than the number of results requested if there were fewer total results available.
    • firstResultPosition: The position of the first result in the overall search.

    Result

    Contains each individual response.

    Title

    The title of the article.

    Summary

    Summary text associated with the article.

    Url

    The URL for the article.

    ClickUrl

    The URL for linking to the article. See URL linking for more information.

    NewsSource

    The company that distributed the news article, such as API or BBC.

    NewsSourceUrl

    The URL for the news source.

    Language

    The language the article is written in.

    PublishDate

    The date the article was first published, in unix timestamp format.

    ModificationDate

    The date the article was last modified, in unix timestamp format.

    Thumbnail

    The URL of a thumbnail file associated with the article, if present, and its height and width in pixels.

    Faults

    400 - application/xml

    See the Standard Error documentation.