How to get same (not similar) images with Bing Visual Search API?

Abhijith Chandran 1 Reputation point
2021-06-08T05:48:41.847+00:00

I am trying to find where all the same image has come. For example if I have the URL to an image A, what all websites does image A appear. I tried using the Bing Visual Search API, however, it shows me similar images. Here is the code I use:

IMG_URL = '<IMAGE URL>'
url_struct  = '{"imageInfo":{"url":"' + IMG_URL + '"}}'

headers = {
    'Ocp-Apim-Subscription-Key': '<API-KEY>',
}

params = (
    ('mkt', 'en-us'),
)

files = {
    'knowledgeRequest': (None, url_struct),
}

response = requests.post('https://api.bing.microsoft.com/v7.0/images/visualsearch', headers=headers, params=params, files=files)

I know for sure that the same image appears at at least one other place. What should i do to get the same image and not similar ones?

Bing Image Search
Bing Image Search
A Bing service that supports searching for images and gets comprehensive results.
49 questions
Bing Visual Search
Bing Visual Search
A Bing service that gives you rich insights to help build compelling image applications on the device of your choice.
25 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. romungi-MSFT 46,831 Reputation points Microsoft Employee
    2021-06-08T09:44:08.263+00:00

    @Abhijith Chandran I have tried this scenario with some images and found that the pages that include the same image are available in the object 'actionType': 'PagesIncluding' in the response JSON.

    This is similar to what you see in the demo page for a test image i uploaded.

     'tags': [{'actions': [{'_type': 'ImageModuleAction',  
                            'actionType': 'PagesIncluding',  
                            'data': {'value': [{'accentColor': '724534',  
                                                'contentSize': '44196 B',  
                                                'contentUrl': 'https://telugu.cdn.zeenews.com/telugu/sites/default/files/2018/09/30/174655-naiduaug27.jpg',  
    

    103357-image.png

    0 comments No comments

  2. Abhijith Chandran 1 Reputation point
    2021-06-09T05:30:47.443+00:00

    @romungi-MSFT Thanks!

    However, here is an example of an image that I searched for. The "Pages with this" shows images that have the image but not the stock/template but the meme with an overlay of text or other modifications. I know that the input image does appear at other places in the exact form without any modifications. Is this expected behaviour or can I do something to change it?

    103689-screenshot-2021-06-09-at-105724-am.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.