Image search parameters seem broken

AI_stud 6 Reputation points
2020-11-07T00:10:18.713+00:00

Hello, I'm trying to do an image search, using the example from the documentation. I'm not sure if the documentation needs to be updated.

Here's the code:

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"

Thank you!

Bing Image Search
Bing Image Search
A Bing service that supports searching for images and gets comprehensive results.
45 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,616 Reputation points
    2020-11-09T10:46:31.203+00:00

    @AI_stud Thanks for the question, Can you please add more details about the key that you are using, is it from marketplace www.microsoft.com/en-us/bing/apis or https://azure.microsoft.com/en-us/services/cognitive-services. We have forwarded to the product team for using client library error to check.

    If the resource created using marketplace please use REST API and follow the below documentation for Bing image search.

    https://learn.microsoft.com/en-us/bing/search-apis/bing-image-search/samples

    0 comments No comments