My Web Application

Resources

Yahoo News Search Service

The Yahoo News Search service provides online searching of news stories from around the world.

Methods

request query parameters
parameter value description

appid

string (required)

The application ID. See Application IDs for more information.

query

string (required)

type

string

One of:

  • all (default)
  • any
  • phrase
all (default)

All query terms.

any

Any query terms.

phrase

Query terms as a phrase.

results

int

Default: 10

start

int

Default: 1

sort

string

One of:

  • rank (default)
  • date

language

string

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.

available response representations:

potential faults:

Representations

A list of news items matching the query (application/xml - yn:ResultSet)

XML Schema

Source: 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>

Faults

application/xml (ya:Error)

XML Schema

Source: NewsSearchError.xsd

<xs:element name="Error">
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element name="Message"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>