How to get image URL in wiki api? - 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.

Related

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 decode steam image url of thing?

Steam images have url like this:
http://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXQ9QVcJY8gulRNRULFV_eS1M7DQEh4IEtDt7ekOQYu1aOQcGgSutizwIPYw6-mYe-AzzhQ68Mj2rmRpd-g3gXm80s9Zm_2cZjVLFH7KrlnRw/330x192
In the API can find these string:
-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXQ9QVcJY8gulRNRULFV_eS1M7DQEh4IEtDt7ekOQYu1aOQcGgSutizwIPYw6-mYe-AzzhQ68Mj2rmRpd-g3gXm80s9Zm_2cZjVLFH7KrlnRw
Is there a way to decrypt it?
I believe that's off topic.
That's probably the image hash not the image itself.
You should then make a call to download said image the same way a browser to.
From the steam API docs:
img_icon_url, img_logo_url - these are the filenames of various images for the game. To construct the URL to the image, use this format: http://media.steampowered.com/steamcommunity/public/images/apps/{appid}/{hash}.jpg . For example, the TF2 logo is returned as "07385eb55b5ba974aebbe74d3c99626bda7920b8", which maps to the URL: [1]

Google Custom Search API Search Image by Image URL

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.

Does Google Contacts API Support High Resolution Pictures?

Google recently added high resolution support (720x720) for contacts' images via the gmail interface. Previously, it would to convert all images to 96x96. However, when I post an image using the Contacts API it still gets converted to 96x96. I currently use the picture url in the link ref http://schemas.google.com/contacts/2008/rel#photo. Is there a way to post higher resolution images or are we still stuck at 96x96 if we use the Contacts API? Is there another programmatic way to accomplish this?
Thanks!
I'm assuming that you are using the Google+ API to retrieve their profile and are looking at the profile image, as seen here using the API explorer:
https://developers.google.com/apis-explorer/#search/profile/m/plus/v1/plus.people.get?userId=107345380056943591322&_h=1&
In the response is an image URL:
"image": {
"url": "https://lh3.googleusercontent.com/-2N7UIsa-tLI/AAAAAAAAAAI/AAAAAAAAAK8/XJiZoMReZr0/photo.jpg?sz=50"
},
You can alter the sz parameter to indicate the width/height of the rendered image, for example:
https://lh3.googleusercontent.com/-2N7UIsa-tLI/AAAAAAAAAAI/AAAAAAAAAK8/XJiZoMReZr0/photo.jpg?sz=500
There are other url formats, it's not clear which url you are getting but if you paste an example, I'd be happy to help.

Google earth browser plugin does not accept custom markers with custom images

I use custom images in google maps markers. I have included google earth control through google earth browser plugin. But they don't show custom images in google earth control? Any way I can solve this problem?
Thanks,
Jayesh
In general, you define your own symbols via Style/Iconstyle/Icon structure first, then you reference them in placemarks using the styleUrl element.
If you have a KML/KMZ that works well with the standalone GE application showing your custom icons, you can load it into the API using some JavaScript like
var networkLink = ge.createNetworkLink('My cool KML/KMZ file');
var link = ge.createLink('Link to My cool ...');
link.setHref('http://www.here.on.the.net/MyCool.kmz');
networkLink.setLink(link);
ge.getFeatures().appendChild(networkLink);
If not you may get the stylemaps into the "internal KML" via some code. For example see here
Hope this helps.
Good luck
MikeD
Try absolute paths for the marker icon's images. Must be a bug of some sort.