On Wed, May 4, 2011 at 10:21 PM, Siteshwar Vashisht <sitesh...@gmail.com> wrote:
> Hi,
>
> Right now I'm using this query to fetch image information:
>
> http://en.wikipedia.org/w/api.php?action=query&titles=File:Navenby.jpg&prop=imageinfo&format=xml&iiprop=timestamp|url|comment|size|dimensions
>
> but iiprop does not have any description parameter. How can I fetch image
> description from Wikimedia Commons? Like this one:
>
> http://commons.wikimedia.org/wiki/File:Navenby.jpg
Get the contents of the description page, like so:

http://commons.wikimedia.org/w/api.php?action=query&titles=File:Navenby.jpg&prop=revisions&rvprop=content

Of course that does require that you figure out whether the file is on
Commons or on the local wiki, but you can tell by
imagerepository="shared" in the imageinfo result.

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to