2016-07-21 23 views
2

Ich versuche, das PyBingSearch-Modul von https://github.com/tristantao/py-bing-search zu verwenden, um die Bing-API zu verwenden, um Suchergebnisse zurückzugeben. Auf der GitHub-Seite haben sie ein Beispiel, wie man es benutzt, das geht.PyBingSearch-Modul: Bing-API-Fehler

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 

Wenn ich versuche, und die Linie laufen, die first_fifity_result I Request returned with code 401, error msg: The authorization type you provided is not supported. Only Basic and OAuth are supported

besagt eine Fehler erklärt, warum dieser Fehler bekomme ich? In meinem Code habe ich sicher gestellt, dass ich Your-Api-Key-Here zu meinem API-Schlüssel ändere.

Antwort

0

Haben Sie Ihren API-Schlüssel getauscht? Wo ist sagt "Your-API-Key-hier"

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