Search code examples
media-queriesmediawikiwikimediawiki-api

Fetching all pictures of certain artist on mediawiki


Currently I'm looking for a way to fetch URLs of paintings on mediawiki that is authored by Albrecht Durer.

Can you point me to a some explanations, is there any API like "give me all images where artist is Albrecht Durer"?

I have found an imageinfo (http://www.mediawiki.org/wiki/API:Properties#imageinfo_.2F_ii), but didn't find how to filter by artist.


Solution

  • There isn't a great way to do that. The structured media data project aims at providing exactly this kind of capability, but it is still ways off.

    Right now, your best bet is using the category system. Category:Paintings by Albrecht Dürer and its subcategories contain the images you are looking for, and you can use the categorymembers API as a generator for imageinfo to fetch the URL's. There is no way to get a recursive list though, so you will have to recurse into subcategories manually. To make it worse, the category graph is not guaranteed to be a tree, so you will have to implement things like duplicate filtering and cycle detection.

    If the wiki in question is Wikimedia Commons, there are various external tools which can help, such as CatScan or catgraph.