Seems that Google doesn’t provide an official API for reverse image search. Here is a little tip to make use of this powerful feature.
You may make use the following URL pattern, just replace <url> with the encoded image url :
https://www.google.com/searchbyimage?image_url=
<url>
For example :
https://www.google.com/searchbyimage?image_url=https%3A%2F%2Fd3ar0cfl4379w2.cloudfront.net%2Fjousun-uploads%2Flarge%2Fproduct%2FVGT1033.jpg
You can then get the search result in your browser or consume it with a scrapper.
Here is a javascript bookmarklet example that making an image search over an Instagram page. Drag this to your bookmark bar. Goto any IG page and run it :
And the underlying js code :
javascript:(function()%7Bvar%20re%20%3D%20%2F(https%3A%5C%2F%5C%2F%5CS*)%20(%5Cd%7B3%2C4%7Dw)%24%2F%3Bimg_src%20%3D%20document.evaluate('%2F%2Fimg%5B%40srcset%5D%2F%40srcset'%2C%20document%2C%20null%2C%20XPathResult.FIRST_ORDERED_NODE_TYPE%2C%20null%20).singleNodeValue.value%3Bwindow.open('https%3A%2F%2Fwww.google.com%2Fsearchbyimage%3Fimage_url%3D'%2BencodeURIComponent(re.exec(img_src)%5B1%5D))%7D)()
Filed under: 軟件開發



Recent Comments