Reverse search an image in Yandex Images using Python

You can get url with an image search by using this code. Tested on ubuntu 18.04, with python 3.7 and requests 2.23.0

import json

import requests

file_path = "C:\\path\\whateverThisIs.png"
search_url = ''
files = {'upfile': ('blob', open(file_path, 'rb'), 'image/jpeg')}
params = {'rpt': 'imageview', 'format': 'json', 'request': '{"blocks":[{"block":"b-page_type_search-by-image__link"}]}'}
response =, params=params, files=files)
query_string = json.loads(response.content)['blocks'][0]['params']['url']
img_search_url = search_url + '?' + query_string

There are no API for developers. You can try reverse inginer queries from your browser, but you will have to deal with anty robot protect.

Another way to speed up process (but still manual)

  1. As described here install Yandex.Browser where you have hot key for image search
  2. Host/make your site with all source images foe search queries
  3. Open your site in Yandex.Browser use "right mouse click"+"serch image at yandex"
  4. Copy what you need from page with results