【问题标题】:PyBingSearch Module: Bing API errorPyBingSearch 模块:Bing API 错误
【发布时间】:2016-07-21 14:34:33
【问题描述】:

我正在尝试使用来自https://github.com/tristantao/py-bing-search 的 PyBingSearch 模块来使用 Bing API 返回搜索结果。在 github 页面中,他们有一个如何使用它的示例。

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 密钥。

【问题讨论】:

    标签: python bing bing-api


    【解决方案1】:

    您是否交换了 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 2017-12-02
      • 1970-01-01
      • 2012-07-13
      • 1970-01-01
      相关资源
      最近更新 更多