Find image by Filename in Wikimedia Commons

Viewed 439

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.

1 Answers

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
Related