I'm trying to search for specific file types in Wikimedia commons API with not much of luck.
Current status: I'm currently able to fetch images with jpeg, png, svg formats normally using this query
Where i'm searching in namespaces 0,6 for the term "searchTerm" which returns images in the mentioned format.
However I'm having alot of trouble filtering out specific file types, for example I need to return only GIF Files ( in .gif format ) or even video/audios. I cannot find that documented anywhere.
A current hack i'm using is a regex in the searchterm and it somehow parses it ( with low accuracy though )
?action=query&generator=search&gsrnamespace=0|6&gsrsearch=/^searchTerm .*gif$/&gsrlimit=30&prop=imageinfo&iiprop=url|mime&iiurlwidth=400px&format=json
Any help ?