<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="wadl_documentation.xsl"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://research.sun.com/wadl wadl.xsd"
 xmlns:tns="urn:yahoo:yn"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:yn="urn:yahoo:yn"
 xmlns:ya="urn:yahoo:api"
 xmlns:html="http://www.w3.org/1999/xhtml"
 xmlns="http://research.sun.com/wadl/2006/10">
  <doc title="Yahoo News Search">
    The News Search service allows you to search the Internet for news stories.
  </doc>

  <grammars>
    <include 
      href="http://api.search.yahoo.com/NewsSearchService/V1/NewsSearchResponse.xsd"/>
  </grammars>
  
  <resources base="http://api.search.yahoo.com/NewsSearchService/V1/">
    <resource path="newsSearch">
      <doc>Sample Request Url: <html:a href="http://api.search.yahoo.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&amp;query=madonna&amp;results=2&amp;language=en">http://api.search.yahoo.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&amp;query=madonna&amp;results=2&amp;language=en</html:a></doc>
      <param name="appid" type="xsd:string" required="true" style="query">
        <doc>The application ID. See <html:a href="http://developer.yahoo.com/faq/index.html#appid">Application IDs</html:a> for more information.</doc>
      </param>
      <method name="GET" id="search">
        <request>
          <param name="query" type="xsd:string" required="true" style="query">
            <doc>The query to search for.</doc>
          </param>
          <param name="type" type="xsd:string" style="query">
            <doc><html:p>The kind of search to submit.</html:p></doc>
            <option value="all">
              <doc>returns results with all query terms</doc>
            </option>
            <option value="any">
              <doc>returns results with one or more of the query terms</doc>
            </option>
            <option value="phrase">
              <doc>returns results containing the query terms as a phrase</doc>
            </option>            
          </param>
          <param name="results" type="xsd:int" style="query">
            <doc>The number of results to return.</doc>
          </param>
          <param name="start" type="xsd:int" style="query">
            <doc>The starting result position to return (1-based). The finishing position (start + results - 1) cannot exceed 1000.</doc>
          </param>
          <param name="sort" type="xsd:string" style="query">
            <doc>Sort articles by relevance or most-recent.</doc>
          </param>
          <param name="language" type="xsd:string" style="query">
            <doc>The language the results are written in. <html:a href="http://developer.yahoo.com/search/languages.html">Supported Languages</html:a>. Omitting language returns results in any language.</doc>
          </param>
          <param name="site" type="xsd:string" style="query">
            <doc>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&amp;site=www.cnn.com).</doc>
          </param>
          <param name="output" type="xsd:string" style="query">
            <doc>The format for the output.</doc>
            <option value="json">
              <doc>Results will be returned in <html:a href="http://developer.yahoo.com/common/json.html">JSON</html:a> format.</doc>
            </option>
            <option value="php">
              <doc>Results will be returned in <html:a href="http://developer.yahoo.com/common/phpserial.html">Serialized PHP</html:a> format.</doc>
            </option>
          </param>
          <param name="callback" type="xsd:string" style="query">
            <doc>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 <html:a href="http://developer.yahoo.com/common/json.html#callbackparam">Yahoo! Developer Network JSON Documentation</html:a>.</doc>
          </param>
        </request>
        <response>
          <representation mediaType="application/xml" element="yn:ResultSet">
            <doc title="News Search Result Set"></doc>
            <param name="ResultSet" style="plain">
              <doc><html:p>Contains all of the query responses. Has attributes:</html:p>
                <html:ul>
                  <html:li><html:b>totalResultsAvailable</html:b>: The number of query matches in the database.</html:li>
                  <html:li><html:b>totalResultsReturned</html:b>: The number of query matches returned. This may be lower than the number of results requested if there were fewer total results available.</html:li>
                  <html:li><html:b>firstResultPosition</html:b>: The position of the first result in the overall search.</html:li>
                </html:ul>
            </doc>
            </param>
            <param name="Result" style="plain">
              <doc>Contains each individual response.</doc>
            </param>
            <param name="Title" style="plain">
              <doc>The title of the article.</doc>              
            </param>
            <param name="Summary" style="plain">
              <doc>Summary text associated with the article.</doc>              
            </param>
            <param name="Url" style="plain">
              <doc>The URL for the article.</doc>              
            </param>
            <param name="ClickUrl" style="plain">
              <doc>The URL for linking to the article. See <html:a href="http://developer.yahoo.com/faq/index.html#clickurl">URL</html:a> linking for more information.</doc>              
            </param>
            <param name="NewsSource" style="plain">
              <doc>The company that distributed the news article, such as API or BBC.</doc>              
            </param>
            <param name="NewsSourceUrl" style="plain">
              <doc>The URL for the news source.</doc>
            </param>
            <param name="Language" style="plain">
              <doc>The language the article is written in.</doc>              
            </param>
            <param name="PublishDate" style="plain">
              <doc>The date the article was first published, in <html:a href="http://en.wikipedia.org/wiki/Unix_time">unix timestamp</html:a> format.</doc>              
            </param>
            <param name="ModificationDate" style="plain">
              <doc>The date the article was last modified, in <html:a href="http://en.wikipedia.org/wiki/Unix_time">unix timestamp</html:a> format.</doc>
            </param>            
            <param name="Thumbnail" style="plain">
              <doc>The URL of a thumbnail file associated with the article, if present, and its height and width in pixels.</doc>              
            </param>
          </representation>
          <fault id="yaError" status="400" mediaType="application/xml">
            <doc>See the <html:a href="http://developer.yahoo.com/search/errors.html">Standard Error documentation</html:a>.</doc>
          </fault>
        </response>
      </method>
    </resource>
  </resources>
  
</application>
