Bing image search API (cognitive) returns broken links?

Bose32 1 Reputation point
2020-07-15T15:49:28.613+00:00

Hi,

I am using Azure cognitive service, more precisely the 'bing image search service'. I send requests to fetch images in relation to a specific keyword.

For this, I make HTTP REST requests to the right azure endpoint:

'https://api.cognitive.microsoft.com/bing/v7.0/images/search?q=MYKEYWORD'

It works well for a lot of requests and results.

However, in some images in the json response of the service, the field 'contentUrl' gives me a broken link to the website hosting the image (404 ,403 or 500 on some different wordpress sites for example).

Therefore, my program which tried to download the image thanks to the 'contentUrl' link crashes (or has to throw at least an exception).

I guess it is because the website changed (by removing the image they were hosting) and bing didn't update its database (or the crawler didn't have time to do so).

I tried to add the "Pragma" no-cache header but it didn't change anything ...

Hence I don't know what to do ...

Any help / advice ?

Bing Image Search
Bing Image Search
A Bing service that supports searching for images and gets comprehensive results.
44 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,414 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GiftA-MSFT 11,151 Reputation points
    2020-07-16T15:38:19.66+00:00

    Thanks for reaching out. I completely understand how inconveniencing this experience may be. I have informed the product team about this feedback. My recommendation would be to handle exceptions or use the content removal tool to Report Broken Links or Outdated Cache Pages. Please let me know if you have any further questions or concerns. Thanks.