Chapter 5. Web Service

The BOSS examples in this section contain reserved characters that need to be escaped. However, for legibility the examples eliminate the escape values. Therefore, if you use these examples verbatim to test queries, they will not work. For a list of all reserved characters and their escape values, see Reserved Characters and Escape Values.

Note

Web search and Image search results are provided by Microsoft Corporation through the Yahoo and Microsoft Search Alliance.

Service URL Syntax

Simple Query Example

Simple XML Response

Optional Arguments (in addition to Universal arguments)

filter

Filters out adult content. Filter=[-porn]

type

Specifies document formats (pdf, msoffice,etc).

view Syntax: view=view1,view2, etc
  • view=language identifies the language of the document
See view section below for more detail.
abstract abstract=long will retrieve and display an abstract of a web document up to 300 characters. This expanded abstract provides the requestor with a larger piece of information to work from in a web search query.
title Example: If you use the following q=president&title=obama would return results with the query “president” and the title containing the query “obama”
url Example: If you use the following q=president&url=obama would return results with the query “president” and the url containing the query “obama”
style Example: style=raw; The style=raw parameter is used to clean out the HTML from the abstract.

When entering Web request arguments you must escape the reserved characters to use them in argument values, although they are sometimes shown un-escaped for readability. See Reserved Characters and Escape Values.

Web Service Arguments

The following arguments are specific to web search.

filter

Optional: This argument filters out results flagged as containing specific kinds of content. Yahoo currently supports values for filtering out results flagged as containing pornographic related content. The Filter argument accepts the values -porn to exclude pornographic content. The syntax of the filter argument is:

filter=[-porn]

The Filter argument applies only to documents in the following languages:

Language

Valid values

Chinese

-porn

Danish

-porn

Dutch

-porn

English

-porn

Finnish

-porn

French

-porn

German

-porn

Italian

-porn

Japanese

-porn

Korean

-porn

Norwegian

-porn

Portuguese

-porn

Spanish

-porn

Swedish

-porn

If you do not specify hate or porn filtering, the results default to unfiltered content.

In rendering a result set, Yahoo automatically demotes adult content, so only users actively searching for adult content are likely to see pornographic results. We recommend that you use Filter: -porn only in a restricted search environment intended to reduce the incident of porn results. Turning on filtering may reduce result relevancy. Also, note that, by their nature, the methods used to flag results as -porn or -hate cannot take into account the subjective, widely varied interpretations and categorizations of such content. You are responsible for your use of the results, regardless of their designation.

Example: https://yboss.yahooapis.com/ysearch/web?q={keywords}&format=xml&filter=-porn

More on Attributes

Capital letter A-Z attributes may appear in search results. These and other attribute categories not mentioned above are experimental and will remain undocumented for now.

type

Capital letter A-Z attributes may appear in search results. These and other attribute categories not mentioned above are experimental and will remain undocumented for now.

Optional: This argument specifies what document types to return. The argument value consists of a comma-separated list specifying the document types or type groups to include. A format group is a logical collection of several document formats for simplification. Format currently supports the following document types:

  • html
  • text
  • pdf (Adobe Portable Document Format)
  • xl (Microsoft Excel: xls, xla, xl)
  • msword (Microsoft Word)
  • ppt (Microsoft Power Point)

Format currently supports the following type groups:

  • msoffice: xl, msword, ppt
  • nonhtml: text, pdf, xl, msword, ppt

You can also specify a format group then exclude an item:

  • type=msoffice,-ppt

This example searches for the same query term in the nonhtml type group (text, pdf, xl, msword, ppt):

  • type=nonhtml

You can combine inclusion, exclusion, document types, and type groups like this:

  • type=html,msoffice,-pdf

Example:

https://yboss.yahooapis.com/ysearch/web?q={keywords}&format=xml&type=msoffice

view=language

Optional: Identifies the language of a document. Expected values are: ca, zh-hans, zh-hant, cs, da, nl, en, fi, fr, de, he, hu, it, id, ja, ko, ms, no, pt, ro, ru, es, sv, tl, th, tr, vi, unknown.

Example XML output:
abstract

Optional: Using abstract=long increases the abstract up to 300 characters and allows BOSS developers to have access to more keywords from the result document. This information may be useful to many for keyword analysis and presentation.

Example:

https://yboss.yahooapis.com/ysearch/web?q=Car%20racing&format=xml&abstract=long

Example XML Output abstract (default):
Example XML Output abstract (long):

Table of Contents