question

TinNguyen-8970 avatar image
0 Votes"
TinNguyen-8970 asked GiftA-MSFT answered

Bing Image Search client library doesn't work

Hi I have a problem when trying to reproduce code from this page https://docs.microsoft.com/en-us/azure/cognitive-services/bing-image-search/quickstarts/client-libraries?pivots=programming-language-python&tabs=visualstudio

pip install azure-cognitiveservices-search-imagesearch

Here is the code that I input in my Jupyter notebook

from azure.cognitiveservices.search.imagesearch import ImageSearchClient
from msrest.authentication import CognitiveServicesCredentials
subscription_key = **
subscription_endpoint = "https://api.bing.microsoft.com/"
search_term = "canadian rockies"
client = ImageSearchClient(endpoint=subscription_endpoint, credentials=CognitiveServicesCredentials(subscription_key))
image_results = client.images.search(query=search_term)

I get the following error:
ErrorResponseException: Operation returned an invalid status code 'Resource Not Found'

I have also tried using
subscription_endpoint = "https://api.bing.microsoft.com/v7.0/images/search"

I have also tried using my cognitive service endpoints and key as well but get a different error
ErrorResponseException: Operation returned an invalid status code 'Forbidden'

What are the difference between all API. What are the difference between cognitive service and bing resources (what are their functionalities, when and how should I use them)

azure-cognitive-searchazure-bing-image
· 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.

Hi, thanks for reaching out. We are looking into this inquiry, will get back to you shortly. Thanks.

0 Votes 0 ·

1 Answer

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

Hi, 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!

84469-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.