Bing Search API returns the "Resource Not Found" error

yjosms 31 Reputation points
2020-11-24T11:28:34.083+00:00

I'm following the quickstart code here: https://learn.microsoft.com/en-us/azure/cognitive-services/bing-web-search/quickstarts/client-libraries?pivots=programming-language-python
I'm using a Bing Resource with the Free Tier.
The endpoint I'm using is https://api.bing.microsoft.com/

When I hit web_data = client.web.search(query="Yosemite"), I receive the following error:

Traceback (most recent call last):
File "

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

3 answers

Sort by: Most helpful
  1. Anusha Vimal 10 Reputation points
    2023-03-30T12:00:48.4133333+00:00

    Changing to that URL doesn't work anymore.

    It has been a year and this is still not fixed. When will Microsoft ever get to fixing this issue with the SDK?

    2 people found this answer helpful.
    0 comments No comments

  2. Lorenzo Balzani 10 Reputation points
    2024-01-15T14:52:05.1966667+00:00

    I resolved the issue. The problem lies in the following file: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/cognitiveservices/azure-cognitiveservices-search-websearch/azure/cognitiveservices/search/websearch/operations/_web_operations.py.

    I changed url = self._client.format_url(url, **path_format_arguments) to url = path_format_arguments['Endpoint'] and the problem has been resolved. I've also submitted a PR, hoping they'll merge it asap.

    2 people found this answer helpful.

  3. John F 0 Reputation points
    2023-07-01T05:44:50.0266667+00:00

    The documentation across Bing and Azure search remains a mess - broken links, conflicting advice and ChatGPT gets lost trying to use Bing to help give accurate answers.

    Maybe MS doesn't really want anyone using API's outside .NET?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.