yahoo web seacher api 参数说明

yahoo搜索引擎api,用起来还是挺不错的,虽然在国内没有google api 当然搜索词数有限制,只能5000/per_ip /perday……,api功能非常全面,搜索结果的语言,国家,格式等都可以非常容易的设置。个人现在用yahoo api 就行 网页去重, 已经还有基于搜索引擎的网络挖掘等方面的研究工作!下面是一些参数,作为备忘之用!

Supported Languages

The following language codes are supported in language parameter requests:

Language Code
arabic ar
bulgarian bg
catalan ca
chinese-simplified szh
chinese-traditional tzh
croatian hr
czech cs
danish da
dutch nl
english en
estonian et
finnish fi
french fr
german de
greek el
hebrew he
hungarian hu
icelandic is
indonesian id
italian it
japanese ja
korean ko
latvian lv
lithuanian lt
norwegian no
persian fa
polish pl
portuguese pt
romanian ro
russian ru
slovak sk
serbian sr
slovenian sl
spanish es
swedish sv
thai th
turkish tr

Request parameters

See information on constructing REST queries

Parameter Value Description
appid string (required) The application ID. See Application IDs for more information.
query string (required) The query to search for (UTF-8 encoded). This query supports the full search language of Yahoo! Search, including meta keywords. Total size of he query must be less than 1KB. For details on constructing queries, see Search Tips.
region string: default us The regional search engine on which the service performs the search. For example, region=uk will give you the search engine at uk.search.yahoo.com. Supported Regions.
type all (default), any, or 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 integer: default 10, max 100 The number of results to return.
start integer: default 1 The starting result position to return (1-based). The finishing position (start + results - 1) cannot exceed 1000.
format any (default), html, msword, pdf, ppt, rss, txt, xls Specifies the kind of file to search for.
adult_ok no value (default), or 1 Specifies whether to allow results with adult content. Enter a 1 to allow adult content.
similar_ok no value (default), or 1 Specifies whether to allow multiple results with similar content. Enter a 1 to allow similar content.
language string: default no value (all languages) The language the results are written in. Supported Languages.
country string: default no value The country in which to restrict your search results. Only results on web sites within this country are returned. Supported Country Codes.
site string: default no value A domain to restrict your searches to (e.g. www.yahoo.com). You may submit up to 30 values (site=www.yahoo.com&site=www.cnn.com).
subscription string: default no value Any subscriptions to premium content that should also be searched. You may submit multiple values. Supported Subscription Codes.
license any (default), cc_any, cc_commercial, cc_modifiable The Creative Commons license that the contents are licensed under. You may submit multiple values (e.g. license=cc_commercial&license=cc_modifiable).
output string: 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.

Sample Request Url: http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=madonna&results=2

Response fields

The schema document for this service response is located at http://search.yahooapis.com/WebSearchService/V1/WebSearchResponse.xsd

Field 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 web page.
Summary Summary text associated with the web page.
Url The URL for the web page.
ClickUrl The URL for linking to the page. See URL linking for more information.
MimeType The MIME type of the page
ModificationDate The date the page was last modified, in unix timestamp format.
Cache
The URL of the cached result, and its size in bytes.

Rate Limit

The Web 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.

Errors

The Web Search service returns the standard errors. There are no service-specific errors.

没有评论: