2016-07-21 6 views
2

https://github.com/tristantao/py-bing-searchのPyBingSearchモジュールを使用して、Bing APIを使用して検索結果を返そうとしています。 githubのページには、それを使用する方法の例があります。PyBingSearchモジュール:Bing APIエラー

from py_bing_search import PyBingWebSearch 
search_term = "Python Software Foundation" 
bing_web = PyBingWebSearch('Your-Api-Key-Here', search_term, web_only=False) # web_only is optional, but should be true to use your web only quota instead of your all purpose quota 
first_fifty_result= bing_web.search(limit=50, format='json') #1-50 

私がしようとfirst_fifity_resultを宣言する行を実行すると、私はこのエラーが出るのはなぜRequest returned with code 401, error msg: The authorization type you provided is not supported. Only Basic and OAuth are supported

を示すエラーを取得しますか?私のコードでは、Your-Api-Key-HereをAPIキーに変更しました。

答えて

0

APIキーを交換しましたか? 「Your-API-Key-Here」はどこにありますか

bing_web = PyBingWebSearch('Your-Api-Key-Here', search_term, web_only=False) # web_only is optional, but should be true to use your web only quota instead of your all purpose quota