2016-07-21 2 views
2

https://github.com/tristantao/py-bing-search의 PyBingSearch 모듈을 사용하여 Bing API를 사용하여 검색 결과를 반환하려고합니다. github 페이지에는 사용법에 대한 예제가 있습니다. 나는 시도하고 first_fifity_result를 선언하는 줄을 실행할 때 나는이 오류가 이유는 무엇입니까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 

나는 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