調べる必要があったので、ついでにメモ。
とりあえず、割と?情報は充実しているようだけど
英語オンリーっぽいので。
APPIDはここで取得
http://www.bing.com/developers/
->サイドバーの 「Create an AppID」
だいたいの情報はここに
http://msdn.microsoft.com/en-us/library/dd251056.aspx
まあSOAPでもRESTでもOKで、
結果もJSONでもXMLでも取得できますよってとこです。
とりあえず一番使うであろうRESTでのクエリーはこれ
http://api.bing.net/xml.aspx?AppId= YOUR_APPID &Version=2.2&Market=ja-JP&Query=検索クエリー&Sources=web&Web.Count=1
web検索系のオプション
Web.*** っていうのがWeb(Sourcesで選んだもの)のオプションです。
今回の場合 Web.countだけですが。
Web.Count は取得件数のことで1-50の間の値のみOK。
これ以外のオプションとして
http://msdn.microsoft.com/en-us/library/dd250876.aspx
Web.FileType(ファイルタイプ)
http://msdn.microsoft.com/en-us/library/dd250920.aspx
Web.Offset(ページの開始位置)
などがあります。
SourceType
SourceType も結構色々合って、面白そうです。
http://msdn.microsoft.com/en-us/library/dd250895.aspx
InstantAnswerとか面白そうなんだけど、
日本語じゃ上手く動いてないみたいですね。
やり方が違うのかな。
Translationはそのまま翻訳。
http://api.bing.net/xml.aspx?AppId=APPID&Version=2.2&Query=Translation&Sources=Translation&Translation.SourceLanguage=En&Translation.TargetLanguage=Ja
こんなかんじでサクっと取得できます。
一応取得結果も
通常Web検索
http://api.bing.net/xml.aspx?AppId=APPID&Version=2.2&Market=ja-JP&Query=転職&Sources=web&Web.Count=1
<SearchResponse xmlns="http://schemas.microsoft.com/LiveSearch/2008/04/XML/element" Version="2.2">
<Query>
<SearchTerms>転職</SearchTerms>
</Query>
<web:Web xmlns:web="http://schemas.microsoft.com/LiveSearch/2008/04/XML/web">
<web:Total>3620000</web:Total>
<web:Offset>0</web:Offset>
<web:Results>
<web:WebResult>
<web:Title>転職はエンジャパンの転職サイト [en]社会人の転職情報</web:Title>
<web:Description>転職経験者が選んだ、総合評価No.1転職サイト。様々な職種・希望条件か...</web:Description>
<web:Url>http://employment.en-japan.com/</web:Url>
<web:CacheUrl>http://cc.bingj.com/cache.aspx?q=%e8%bb%a2%e8%81%b7&d=76586192667331&mkt=ja-JP&w=f10d1e04,45e7a1ad</web:CacheUrl>
<web:DisplayUrl>employment.en-japan.com</web:DisplayUrl><web:DateTime>2009-08-19T02:01:43Z</web:DateTime>
</web:WebResult>
</web:Results>
</web:Web>
</SearchResponse>
翻訳
http://api.bing.net/xml.aspx?AppId=APPID&Version=2.2&Query=Translation&Sources=Translation&Translation.SourceLanguage=En&Translation.TargetLanguage=Ja
<SearchResponse xmlns="http://schemas.microsoft.com/LiveSearch/2008/04/XML/element" Version="2.2">
<Query>
<SearchTerms>Translation</SearchTerms>
</Query>
<tra:Translation xmlns:tra="http://schemas.microsoft.com/LiveSearch/2008/04/XML/translation">
<tra:Results>
<tra:TranslationResult>
<tra:TranslatedTerm>翻訳</tra:TranslatedTerm>
</tra:TranslationResult>
</tra:Results>
</tra:Translation>
</SearchResponse>