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
I've used Magnus' Commons API tool. It's not designed to be just dropped into a project, but if you copy the source of the wiki page it calls and cache it locally, then move the logic into a class you can make it more easily callable. Here's the source for Magnus' version. If you want the class I created from it let me know and I'll dig it out.