雅虎!Answers webservice实际上不是 SOAP,而是基于 REST 的。
例如,请参阅问题搜索方法的文档。对于您搜索“经济学”的示例,调用如下所示:
http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=your-appid-here&query=economics
这将返回(片段):
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:answers" xsi:schemaLocation="urn:yahoo:answers http://answers.yahooapis.com/AnswersService/V1/QuestionResponse.xsd">
<Question id="20080829001109AAOc4h9" type="Answered">
<Subject>Economics...?? ?</Subject>
<Content>HSC economics? i have a choice to do economics and i really have no idea what it's about, i am aware it is about money and finance however i am a bit vague with the subject, can any one shed some light on the subject??
thanks for your help.
</Content>
<Date>2008-08-29 00:11:09</Date>
<Timestamp>1219993869</Timestamp>
<Link>http://answers.yahoo.com/question/?qid=20080829001109AAOc4h9</Link>
<Category id="396545359">Higher Education (University +)</Category>
<UserId>LJHkcrxcaa</UserId>
<UserNick>Sam</UserNick>
<UserPhotoURL></UserPhotoURL>
<NumAnswers>2</NumAnswers>
<NumComments>1</NumComments>
<ChosenAnswer>Most people misunderstand what Economics is all about. It is not particularly similar to accounting or finance. Businessmen can benefit from understanding it, but it is not "business." Rather, Economics is a Social Science concerned with understanding how humans allocate scare resources. What goods and services do we produce? How much of each good or service do we produce? Who does the producing, and who does the consuming? Do we ever choose not to produce (for example in order to conserve a natural resource because we value it for it's own sake)? How do we decide these things? Etc. That is what Economics is about. I personally find it a very interesting subject, though it takes some effort at first.</ChosenAnswer>
<ChosenAnswererId>Gjj5eCG6aa</ChosenAnswererId>
<ChosenAnswererNick>RCM</ChosenAnswererNick>
<ChosenAnswerTimestamp>1220067546</ChosenAnswerTimestamp>
<ChosenAnswerAwardTimestamp>1226969668</ChosenAnswerAwardTimestamp>
</Question>
...
</ResultSet>
如果你想走这条路,你需要注册一个 AppID 密钥。这将有助于避免速率限制问题。
另一个不错的选择(也更面向未来)是通过YQL访问 Answers API ,示例查询如下:
select * from answers.search where query="economics"