How to get image URL in wiki api?

11.4k views Asked by At

When I call wiki APIs for accessing image URLs, I get image URLs like this,

File:Ad-tech London 2010 (2).JPG

How to get the correct URL of this file from wiki API?

2

There are 2 answers

0
brightbyte On

You can get the proper URLs from an imageinfo query like this:

https://en.wikipedia.org/w/api.php?action=query&titles=File:Test.jpg&prop=imageinfo&iilimit=50&iiend=2007-12-31T23:59:59Z&iiprop=timestamp|user|url

More info at MediaWiki API Help.

1
simon04 On