Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# Example code from image api
from azure.cognitiveservices.search.imagesearch import ImageSearchAPI
from msrest.authentication import CognitiveServicesCredentials
# Add your Bing Search V7 subscription key to your environment variables.
subscription_key = ''
search_term = input()
# create the image search client
client = ImageSearchAPI(CognitiveServicesCredentials(subscription_key))
# send a search query to the Bing Image Search API
image_results = client.images.search(query=search_term)
print("Searching the web for images of: {}".format(search_term))
# Image results
if image_results.value:
first_image_result = image_results.value[0]
print(format(first_image_result.content_url))
else:
print("Couldn't find image results!")
# End of example code from image api