Is it possible to use the MediaWiki API to return a random image? If so can I specify a filetype such as SVG?
Asked
Active
Viewed 940 times
1 Answers
4
Random, yes; by file type, no.
If you know that the image namespace is 6, then you can use:
http://commons.wikimedia.org/w/api.php?action=query&list=random&rnnamespace=6
Note that most images on Wikipedia are on Wikimedia Commons, hence the commons.wikimedia.org URL. If you want image info, such as the URL, use random as a generator:

Bryan
- 692
- 5
- 9