Google images: get large image URL from thumbnail URL
Asked Answered
H

4

9

Is there any way to build the URL of a medium/large/original image corresponding to a thumbnail URL returned by the Google Custom Search API?

In other words, from this thumbnail URL:

https://t3.gstatic.com/images?q=tbn:ANd9GcRYiGRk0xt6OXpRa3j7ySJNeATepTe7zaWzm1G6KpGAwpHePcTmYPYp6WI

is it somehow possible to find the URL of a bigger image?

I tried to replace tbn (for 'thumbnail'?) in the q URL param by medium, large,... but without success.

Huldahuldah answered 13/1, 2015 at 15:6 Comment(3)
Don't think it's possible.Acanthous
Can you please post the json data you are getting?Ashy
@DipenPatel well, I only have the thumbnail URLs now, not the original JSON dataHuldahuldah
A
1

I'm pretty sure this is not possible with any permutation of the thumbnail URL. I don't think there is any relationship between the thumbnail name and the original's name. The thumbnail is called "Billy" and the full image is called "Peter". There's no relationship between the two to my knowledge.

Furthermore, if you have the thumbnails stored, it's not even a foregone conclusion that the original images still exist at their original location. Nor will the API be helpful doing a reverse image search.

The best you can do (to my knowledge) is attempt to scrape a reverse image search based on the thumbnail. This will in the majority of cases -- but certainly not all cases -- give you the large image URL. But only if the original image still exists. (Of course, scraping Google is a violation of TOS... so be aware of the downsides)

http://skyzerblogger.blogspot.jp/2013/01/google-reverse-image-search-scraping.html

Acanthous answered 10/2, 2015 at 4:35 Comment(1)
How could I use your solution in JavaFX? I mean, the webview(the internal browser of JavaFX) has not hte same "potential" of normal browsers. If I go to images.google.it I haven't the camera logo on my webpage...Ribeiro
F
1

This might not be the perfect answer , but it is a perfect work around in your case , as you have a specific problem , that not everyone has , and you only have the thumbnail resource available.

Using the custom google search api you can actually start searching for similar images like the one you actually have , which will for sure return exact matches ( as the thumbnail is fetched before using google search ).

For Example

this is a thumbnail image URL:

https://t3.gstatic.com/images?q=tbn:ANd9GcRYiGRk0xt6OXpRa3j7ySJNeATepTe7zaWzm1G6KpGAwpHePcTmYPYp6WI

and this is the large results returned by using thumbnail image URL:

https://www.google.com.eg/search?sa=G&q=domestic+shorthair+cat&tbm=isch&tbs=simg:CAQSxwEaxAELEKjU2AQaAggEDAsQsIynCBqcAQo6CAISFMghlRScFL8TnhSXIPcdmSCTIcUhGiDIAu9X2fApCXdkXBwfLo_1kiDszYQcYF96Sg7sPDcwYBgpeCAMSKOsLjQTsC48E8gqeFYEF3RaOBNoWoy2iLbAioiOaI5kjoC2hLbsk3yEaMFWwvVZ7aOHrJIxtE09n9d-g8XCiJ1fbX0O5IHN1tWuHZNVrNQkBJrcx8RM4KEMRUwwLEI6u_1ggaCgoICAESBC_1KA-UM,isz:l&ei=C_7ZVM-FMOvmywO32IKQDQ&ved=0CBwQ2A4oAw&biw=1280&bih=637

after applying Large Filter

Custom Search enables image search now , and also enable filtering results, please read more Here

Flaring answered 10/2, 2015 at 12:53 Comment(0)
A
0

Isn't the full-size image part of the API response? I guess that would depend on your custom search engine. I get the full-size image urls in the API response:

 "pagemap": {
    "cse_image": [
     {
      "src": "http://s7d2.scene7.com/is/image/Caterpillar/europe?fmt=png"
     }
    ],
    "cse_thumbnail": [
     {
      "width": "268",
      "height": "188",
      "src": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSNgH0zizPMBTKKfKfQNhdAOhU-VUFFqQResFZKvjzJYFpUm5Ptt4V4j7E"
     }
    ],
Acroter answered 1/2, 2015 at 21:49 Comment(1)
Sure, but my problem is that I have only stored thumbnail URLs (not the original search queries) and now I would like to find the large size images corresponding to those thumbnailsHuldahuldah
A
0

You can use http://mrisa.mage.me.uk or https://www.mashape.com/imagesearcher/camfind#!documentation which will allow you to download full size image.

Ashy answered 10/2, 2015 at 13:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.