Hi vjkumar,
On 06-Sep-2012, at 6:57 PM, vjkumar wrote:
I am able to construct the URL for the image as
http://commons.wikimedia.org/wiki/File:Ethiopian_-_Coin_Depicting_an_Anonym….
However I would like to get the thumbnail url, Title and the description
for the images in this category with a query and get the output in XML or
JSON format . Is it possible to construct such a query?
Yup! You need to use the
'imageinfo' API call (documentation available at
http://www.mediawiki.org/wiki/API:Properties#imageinfo_.2F_ii). Try this URL:
http://commons.wikimedia.org/w/api.php?action=query&titles=File:Ethiopi…
(here's the tinyurl:
http://tinyurl.com/8tgdjoc)
You can adjust iiurlwidth to the width of the thumbnail you need. This will give you the
thumbnail URL and title in the XML it emits; to get the description, you will need to read
the page content itself, via a
http://www.mediawiki.org/wiki/API:Properties#revisions_.2F_rv request (e.g.
http://commons.wikimedia.org/w/api.php?action=query&prop=revisions&…)
(here's the tinyurl:
http://tinyurl.com/9fbg8q4)
Hope that helps!
cheers,
Gaurav
(User:Gaurav)