question

ArashVafanejad-3467 avatar image
0 Votes"
ArashVafanejad-3467 asked KiranRaniJahagirdar-7016 commented

Bing Search API returns the "Resource Not Found" error

I'm following the quickstart code here: https://docs.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/

87865-image.png

Why am I getting these errors and how to solve the issue?


azure-cognitive-servicesazure-bing-web
image.png (87.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GiftA-MSFT avatar image
0 Votes"
GiftA-MSFT answered

Hi, thanks for reaching out. The Cognitive Image Search API got migrated to Microsoft Bing, please refer latest document. Ensure to use your Bing Resource Key as shown below. Let us know if you have further questions, thanks!

87971-image.png



image.png (129.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ArashVafanejad-3467 avatar image
0 Votes"
ArashVafanejad-3467 answered KiranRaniJahagirdar-7016 commented

Thank you very much, but this did not solve the issue,
Also I am trying to use Bing search rather than image search.

Could you please direct me to the document regarding news search (similar to the one I shard in the first post)
I get the following error:


HTTPError Traceback (most recent call last)
<ipython-input-7-808139fa1eb0> in <module>
1 response = requests.get(search_url, headers=headers, params=params)
----> 2 response.raise_for_status()
3 search_results = response.json()
4 thumbnail_urls = [img["thumbnailUrl"] for img in search_results["value"][:16]]

/usr/local/lib/python3.9/site-packages/requests/models.py in raise_for_status(self)
941
942 if http_error_msg:
--> 943 raise HTTPError(http_error_msg, response=self)
944
945 def close(self):

HTTPError: 401 Client Error: PermissionDenied for url: https://api.bing.microsoft.com/v7.0/images/search?q=puppies&license=public&imageType=photo

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

For news search you can use the following API references : https://docs.microsoft.com/en-us/bing/search-apis/bing-news-search/reference/endpoints

Also make sure to check the supported pricing tiers for Bing news search in particular. https://azure.microsoft.com/en-in/pricing/details/cognitive-services/search-api/

0 Votes 0 ·