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
From http://www.mediawiki.org/wiki/API_talk:Main_page#Image_license_information Is there a way to get the license of an image through the api? By category is probably easiest, assuming the site categorizes by license. There is no built in module though for license information. Splarka 08:45, 22 January 2010 (UTC)
However, I find that using categories doesn't return anything for many images even though they have a license specified. Maybe the best way is to parse the rendered html of the image page.