Google Custom Search API Search Image by Image URL - api

I am working on an application which will have an option for users to upload images. Once uploaded, the application will show other images from the web which look exactly similar, whether or not of the same size.
For this, I will create a temporary URL for the image so that I could provide Google custom search API the URL of the image. I would expect in response, URL's of images that are exactly the same or similar to it, perhaps in JSON format.
I did find a similar question posted in January. Till then Google did not support anything like this, apparently:
Google Javascript Custom Search API: Search images by image url
One can also simply do:
http://images.google.com/searchbyimage?site=search&image_url={Image URL}
Since that is not part of an official API, it may not be right to use this method.
Can someone help me?

Well, the answer quite simply is TinEye Commercial API https://api.tineye.com/welcome. I was looking in the wrong place I guess, I did not have any luck with Google Custom Search API.

Would you need a simple result?
If you are, you can use Vision API of Google.
This is very simple.
https://cloud.google.com/vision/
You can try on the top.
First, access the URL.
Second, upload your image file on the "Try API"
Third, click "JSON" tab menu on the result.
You can be seen JSON about similar images.

Related

Rich links in hangouts chat

I'm working on the sharing aspects of a website, and got stuck with google's hangouts chat.
I want links to the site to be displayed as "cards" with my preview image (ideally, an animated gif), the same way these are:
https://github.com/kkroening/ffmpeg-python
https://xkcd.com/387/
https://www.youtube.com/channel/UC2hxYQtGLEkcOMK4h8JRycA
I was hoping the generic "og:image" meta tag would do the trick, but that's not working
So, I checked out the source code of these pages, but that didn't help either:
In the github page, for example, the url to the image can be found in the og:image and twitter:image:src meta tags. I thought it would be weird for 'twitter:image:src' to be the solution, but I tried anyways. It didn't work.
I've been looking everywhere for some documentation on this, but all I can find is stuff about creating a bot, which is not what I'm looking for.
Thanks for any advice

Google Visually Similar Image API

I know there is this link to find visually similar images to an uploaded picture
https://www.google.com/searchbyimage?site=search&sa=X&image_url=YOUR_IMAGE_URL
but is there also a way to get an API for the first result of the visually similiar image?
I have sympathy what you need.
I try to use google cse but this is not supported similar images.
So, Next that I try, URL.
But this is able to on the browser.
I just need result of simliar images and then I wish that result is visually.
So,
you can use Vision API of Google.
This is very simple.
https://cloud.google.com/vision/

How to get image URL in wiki api?

When I call wiki APIs for accessing image URLs, I get image URLs like this,
File:Ad-tech London 2010 (2).JPG
How to get the correct URL of this file from wiki API?
There's little documentation on image/thumbnail URLs besides T153497. You can use Special:FilePath and/or thumb.php:
https://commons.wikimedia.org/wiki/Special:FilePath/Ad-tech_London_2010_(2).JPG
https://commons.wikimedia.org/wiki/Special:FilePath/Ad-tech_London_2010_(2).JPG?width=200 (to get a thumbnail of 200px width)
https://commons.wikimedia.org/w/thumb.php?f=Ad-tech_London_2010_(2).JPG&w=200
You can get the proper URLs from an imageinfo query like this:
https://en.wikipedia.org/w/api.php?action=query&titles=File:Test.jpg&prop=imageinfo&iilimit=50&iiend=2007-12-31T23:59:59Z&iiprop=timestamp|user|url
More info at MediaWiki API Help.

Incorrect image displayed when Gigya opens Google Plus share modal

I'm working with Gigya's Share Bar javascript api and am having an issue with google plus sharing. I have separate UserAction objects for facebook, twitter and google plus to display different text and linkbacks. I'm adding a media item (image) to the facebook and google plus actions to share that image along with the text. Facebook is sharing the correct image, however, google plus is displaying a different image. I have no idea where this image is coming from. Text and link are correct on both, but the image is frustratingly incorrect.
Has anyone encountered an issue like this? Is there something different that must be done for google plus shares?
Test your target URL with Google's structured data testing tool.
Read the snippet documentation to understand how the Google crawler determines what to use in the share preview.

Show a single thumbnail when posting on facebook

A little background info is that my team and I developed a website for a Real Estate Agency and I've been assigned the task of setting the image of the currently selected property into facebook's sharing feature.
The webpage for the property is dynamic as there are several listings, so what I've done is select the first image that is loaded on the page and set it to the og:image meta tag.
Now let's say I copy the URL and post it on Facebook, it'll show the correct thumbnail, HOWEVER, it'll also show multiple thumbnails from other listings.
All images on the website are over 200 x 200px and are within an aspect ratio of 3:1.
My question is, how do I tell Facebook to only take my initial image and not grab others while it's as it.
Is there perhaps a SelectSingleImage property that I can apply?
I've already spent more time searching for the answer to this issue than I would have liked, so thanks for any help provided, it's much appreciated.
One method I use sometimes is to recognize Facebook's server and simply provide it with different data. This way you can actually only have one image on the page (as far as Facebook knows).
I don't know anything about vb.net, but here is a simple code sample in PHP. All it does is perform a regular expression on the user agent of the request to match it against the string "facebook".
$isFacebook = false;
if(preg_match("/facebook/",strtolower($_SERVER["HTTP_USER_AGENT"]))) {
$isFacebook = true;
}
Facebook may very well change their user agent signature one day, but for now, I'm pretty sure you'll be safe but keep synced with the Developers Blog and the Roadmap.
It seems that Facebook saved those images in cache for some bizarre reason, but to resolve this issue all I had to do was enter the URL into Facebook's Linter tool which in turn cleared the cache on their server.