How to compose the URL for a reverse Google image search?
Asked Answered
M

3

28

I'm managing a photo sharing website and as an admin I'd like to have a button that checks the origin of the uploaded photo (for the sake of copyright infringements).

My idea was to simply launch a URL to the Google reverse image search service, passing in my image URL as a parameter in the URL. I have no need for automated back-end integration, I'll just click that button for suspicious images and check the results manually and visually.

As the Google Image Search API is deprecated, I'm trying to figure out how these reverse URLs are encoded. Here's an example:

https://www.google.com/search?tbs=sbi:AMhZZiu4Yrek2BpiwyGk9IsHVNZf-iYz5hbuYqkEQltbV2v9Gw5Jh5d9Od1vKAHMAHIwCy3Z5bb5XgsTSfSRp--8NvG9BGxSNEFkd5tjHKH3EQHUTkOL_1MaFPK9DYRbNERlhG0bem6Lic1U8KN0TbtjfaKqVpKOnOgveoygHHN6xCiABQktN5AdZOs8F5BrXtIEZZf-CpVj_1Fd09ffaN9JE7hdEZPeM804rQgLP9UZe7QPIDG4Pn50Pcl5v1QgFUG6HO4U2Yhc54whAvC8SpyD1-hdCyDCa0rUn1E4KZrQFbIB6kodhQbOZXQxYdaQsY74g54jxsgtZeKt9rbhDzCMRrNkSsJwMlfv6NF5H4QPR8coHogn9nKkLUi3PgcJ-1rehd0EDssook5IPRVq5hH84j6vDbq0kbUtYxUkJwXm3_1C6jn-4hiR-W8c19HM63tcIIohTfmrca-kyN4rhHlkEjlL1684AICeyml8jx1rbBxCtiQcedyDKWiFxCbNpTUZ2z-Psx7EAQJ9AKu1BeRdi-7d5GbVpNwq_1h_13jBynarvhfqyPje7ZolbIwVoQt66ctO9I8OtVj1LAfjMG8AE3Id1v2e0FVfMZCN_1r_178KbudnT61GQYGiy9AkKAJ509Uy7flMlvPAVzkV2QTHqrL46Vh9rcy2kExYXzt_1pcq4AApKzCtRhaSazHx8V0gQrmopqRA9kmpto2yFOgTR0E8EAPNU-egb4dQC4FIZSBGTOKb2eIdjqEybZlhjcuoGIriKYrgWIWyBhfFJ2MIOTYMGRpvNytugXhkR9Cd9g2Xv37bVf3NedpfXbqOJKFlHi4KmhGK7PrCRcbCo18WxTQuzrr6xJvrdr0i3tPWYVOcXjJB5K3mBZFcDP90nsYLOU1TE1nVYFVmMVCK2kdxeUZmIYb_1S3XGZyz_1AkZkgk0jzM6f5dGHz4rVOEmBPSs-mjLDf67-4w9Ro7JZGg2HDDGewrWzaJhbQfGxuBE8MgAts5aPTDuqtUADYfxkubQmDxmbih26-ypk9EIbo6FNLie_1lzenC442iBZadZOwcBJI6h7o8zBgQPaJkKsr_1lILo7aCX9zbGWydzkpvJXZEXUm9oci02uz3sCIJ9djDl2h3qttETJEwgoApkY5uC6s4Sgydwu0_1b4_1F6-61604_1n558xMvcmj9BeiFqxw&num=10&hl=en&bih=1029&biw=1920

I'm figuring the SBI param is an encoded version of the URL. Does anyone know what kind of encoding this is?

Marcelina answered 30/11, 2011 at 11:17 Comment(1)
Looks like this thread might be of some help: #7585308Akilahakili
B
45

It's not entirely clear what you want but if you throw your image URL at the end of this, google will return the results of the google reverse image search.

https://www.google.com/searchbyimage?&image_url=

Belletrist answered 13/12, 2012 at 11:57 Comment(4)
2017, still going strong. Loved seeing that permalink shrink from 1403 characters to 148.Prefiguration
Works only in browser and with browser plugins. Does not work from Java (P3P Policy fail) :( . If someone has a workaround for this, tell ME!Psych
To expand on what CodeNashor said, using this from code does not work—it only works in a browser.Tecu
Unfortunately, as of this week (nov 2022) this solution has been closed by Google. Now, you have to go through their useless Google Lens (see @pureth's answer) and click image source.Jimerson
F
13

Here's how you'd compose a url for Google Lens. It's much newer and returns incredibly accurate search results!

https://lens.google.com/uploadbyurl?url=

Just append your url to the end.

If your url contains special characters be sure to URL encode it. e.g. in JavaScript:

const googleLensSearchByImage = function (src) {
    return `https://lens.google.com/uploadbyurl?url=${encodeURIComponent(src)}`;
};
Fixed answered 3/10, 2022 at 18:45 Comment(2)
Finally a simple and working answer. Thanks.Carilla
Is there any way to do a local upload?Immotile
W
0

I think that the images are converted into base64 and then the base64 code is compared with other entries in the database. Is any other way to compare the data if it is not in some sort of digital / numerical form.

Witt answered 8/8, 2019 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.