Not able to get Microsoft bing Image search API key

As a student ,Currently I don’t have credit card to sign in for free account of microsoft azure , that’s why i am not able to create a API key for bing image search API . Is there any alternate way to get the API key , so that i can follow up with the course partical deep learning for coder part 2 (2020)

1 Like

Microsoft has made some changes on 30 Oct, so the API seems no longer working. So as a workaround, you can use bing-image-downloader as below:

!pip install bing-image-downloader
from bing_image_downloader import downloader"grizzly bear", limit=150, output_dir='bears', adult_filter_off=True, force_replace=False, timeout=5)"black bear", limit=150, output_dir='bears', adult_filter_off=True, force_replace=False, timeout=5)"teddy bear", limit=150, output_dir='bears', adult_filter_off=True, force_replace=False, timeout=5)

path = Path('bears/grizzly bear')
path = Path('bears/black bear')
path = Path('bears/teddy bear')

Thank you so much rshun !!!

It didn’t work in my case! can you share your code?

just add a new cell and run the code provided by rshun to download the image set

If facing “NameError: name ‘Path’ is not defined” need to add: from pathlib import Path

I took rshun’s reply above and dropped it into place in the “clean” version of the 02_production notebook, then removed any code no longer required due to the change in download tool.

You end up with the attached image, which you can see all works fine (I am using Paperspace free tier):

Note that I got pretty terrible image results every time - usually had to delete massive amounts of them when running the later code block to do with “cleaner” - so not sure if this alternative downloader tool gives better/worse results than the one the notebook wanted us to use.


Thank you so much. I wasted so much time in finding the solution online :slight_smile:

Thank you so much. It works for me.

hi I follow your code it works! but I have problem with learn.export() would you mind share your note book in this part?