Bing Search API returns the "Resource Not Found" error

yjosms 26 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.
128 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. 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

  3. Lorenzo Balzani 0 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.

    0 comments No comments