I would like to add a function to my App similar to the "Best guess" section like the pic below, what is the best way to implement such feature? Any advice will be appreciated.
Further more, since Google image search API has been deprecated, and the new custom search API doesn't seem to provide reverse image search, is there any other service that provides similar reverse image searching function?
My guess is:
It seems that currently the only way (not the best I think) to get best guess for image is to scrape it from Google response. I tried TinEye , but it perform image search much worse than Google.
Something like the following:
String newUrl = "http://www.google.com/searchbyimage?hl=en&image_url=http://media.tumblr.com/745c48c1dcf79c51f64f69c64d0cf095/tumblr_inline_ms5a0kJVT51qz4rgp.jpg";
Document doc = Jsoup.connect(newUrl).userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36").get();
Elements bestGuessElement = doc.select("a.qb-b");
String bestGuess = null;
if (!bestGuessElement.isEmpty() && bestGuessElement.hasText()) {
bestGuess = bestGuessElement.text();
}
System.out.println(bestGuess);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With