2

When I call this API https://en.wikipedia.org/w/api.php with following params:

"action": "query",
"format": "json",
"titles": "Albert Einstein",
"prop": "images"

I just get the title of the following images. For example the title: File:Name-of-file.svg

But how can I actually have the link of this file? To find the original size image in Wikimedia Commons. It begins with https://upload.wikimedia.org/wikipedia/commons but then there is a URL folder with a different name for every image, then follows the image name. Is there an API for this? Currently I'm using https://www.mediawiki.org/wiki/API:Images

Thanks.

aosh5
  • 89
  • 1
  • 6

1 Answers1

7

Just to need use imageinfo&iiprop=url

https://en.wikipedia.org/w/api.php?action=query&titles=File:Albert_Einstein_Head.jpg&prop=imageinfo&iiprop=url
Siarhei
  • 214
  • 1
  • 4