Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving image license and author information in wiki commons

I am trying to use the wikimedia API for wiki commons at:

http://commons.wikimedia.org/w/api.php

It seems like the commons API is very immature and the part at their document that mentions the possibility to retrieve license and author information is empty.

Is there anyway I can retrieve the paragraph that contains the information about the licensing using the API? (For example, the paragraph under the title "Licensing" at this page). Of course I can download the whole page and try to parse it, but what are APIs for?

like image 448
Meir Avatar asked Sep 17 '11 08:09

Meir


People also ask

Are images on Wikimedia Commons copyright free?

Free to use All media files on Wikimedia Commons can be used by anyone, including commercially and each media file has information about which license it uses. The most common licenses used are created by Creative Commons which require the author to be credited.

How do you cite an image from Wikimedia Commons?

Title of image/video [linked to original image] by Author [linked to profile page] under License [linked to license deed]. FOR PUBLIC DOMAIN IMAGES: Your attribution should follow this format: Title of work [linked to original image] by Author, Date (if known, or n.d. if not known).

Is Wikipedia Creative Commons license?

All text on Wikipedia is licensed under the Creative Commons Attribution/Share-Alike 3.0 Unported License, following a transition from the GFDL.

Do you have to cite Wikimedia Commons?

WIkimedia Commons All images, sounds, and videos are contributed by the public and are free to use. However, they must be cited for attribution because most have a Creative Commons license.


2 Answers

Late answer but you can request the "extmetadata" data with the following query:

http://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File%3aBrad_Pitt_at_Incirlik2.jpg&format=json

Look under imageinfo.extmetadata.UsageTerms, Artist, Credit, etc.

like image 186
Philippe Green Avatar answered Oct 11 '22 13:10

Philippe Green


You could try using Magnus Manske's Commons API tool on the Wikimedia Toolserver. It's not an official service, and the documentation seem to be rather sparse (that is to say, almost nonexistent), but the XML output seems pretty self-explanatory.

I can't seem to find the source for Magnus's script anywhere, but I assume it extracts the licensing information from the categories the file belongs to. If you wanted, you could do that yourself: just fetch the list of categories and, if necessary, walk up the category tree until you find a license category you recognize. Alas, the tree-walking part requires either multiple API requests or a database of Commons categories (either live access on the Toolserver, or a reconstructed copy from the database dumps).

Yes, I realize that this answer may seem unsatisfactory. The fact is that Magnus's script seems to be the closest currently existing thing to what you want, and even it's marked as experimental and incomplete. Basically, this is a problem waiting for someone to implement a (better) solution.

like image 25
Ilmari Karonen Avatar answered Oct 11 '22 12:10

Ilmari Karonen