Azure BingSearch API couldn't run because of KeyError

悠暉 山本 0 Reputation points
2024-01-05T03:44:15.8166667+00:00

Bing's SearchAPI is not working. What should I do? I would appreciate it if you could provide guidance.

Programming language : Python

API : Bing Search API

Reference: https://github.com/microsoft/bing-search-sdk-for-python/blob/main/samples/rest/BingWebSearchV7.py

Type of error: KeyError

Bing Web Search
Bing Web Search
A Bing service that gives you enhanced search details from billions of web documents.
128 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 17,280 Reputation points Microsoft Employee
    2024-01-05T06:10:58.0666667+00:00

    @悠暉 山本 Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    .

    I tried executing the same sample mentioned here:
    https://github.com/microsoft/bing-search-sdk-for-python/blob/main/samples/rest/BingWebSearchV7.py
    .
    It worked fine and I got a successful response from the Bing Search API endpoint.
    .
    Please ensure that you have entered your key and endpoint details correctly as shown below and check if that helps.

    # Add your Bing Search V7 subscription key and endpoint to your environment variables.
    subscription_key = "aae3XXXXXXXXXXfe1c31"
    endpoint = "https://api.bing.microsoft.com" + "/v7.0/search"
    

    .

    If you have any follow-up questions, please let me know. I would be happy to help.

    0 comments No comments