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

downloader.download("grizzly bear", limit=150, output_dir='bears', adult_filter_off=True, force_replace=False, timeout=5)
downloader.download("black bear", limit=150, output_dir='bears', adult_filter_off=True, force_replace=False, timeout=5)
downloader.download("teddy bear", limit=150, output_dir='bears', adult_filter_off=True, force_replace=False, timeout=5)

path = Path('bears/grizzly bear')
path.rename('bears/grizzly')
path = Path('bears/black bear')
path.rename('bears/black')
path = Path('bears/teddy bear')
path.rename('bears/teddy')
11 Likes

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.

2 Likes

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?

If you’re unable to create an API key for the Microsoft Bing Image search API because you don’t have a credit card, there might be an alternative solution for you. One option is to explore the Microsoft Learning Partner program, which offers various courses and training opportunities to enhance your skills in Microsoft technologies. By joining the program, you can access valuable resources and guidance that can help you navigate through your deep learning course and other Microsoft-related endeavors. They might provide assistance or alternative methods to obtain the API key you need, even if you don’t have a credit card.

hi

All the posts here seem from 2020…it is Sep '23 as I am writing this…I have followed google searches, forum suggestions, my own trials and errors but despite signing up on MS, I am still unable to even find where to get the Bing Image seach API key

If anyone has cracked this recently (which means you know the current navigation on MS site0, please do advise!