how to get image search result using bing search api with python?

1.1k views Asked by At

I need some image sample for machine learning training. I have not enough resource now, so I need to crawl some using the search engine. Google is not free now and I choose bing.

I have tried pybing. It seems not work now.

I don't known how to get the appid.

1

There are 1 answers

0
Manav Mehra On
from py_bing_search import PyBingImageSearch


bing_image = PyBingImageSearch('Your-Api-Key-Here', "x-box console", image_filters='Size:medium+Color:Monochrome') #image_filters is optional

first_fifty_result= bing_image.search(limit=50, format='json') #1-50

print (first_fifty_result[0].media_url)