Accessing main picture of wikipedia page by API

insomiac picture insomiac · Dec 2, 2011 · Viewed 40.2k times · Source

Is there any way I can access the thumbnail picture of any wikipedia page by using an API? I mean the image on the top right side in box. Is there any APIs for that?

Answer

Assaf Shemesh picture Assaf Shemesh · Dec 1, 2013

You can get the thumbnail of any wikipedia page using prop=pageimages. For example:

http://en.wikipedia.org/w/api.php?action=query&titles=Al-Farabi&prop=pageimages&format=json&pithumbsize=100

And you will get the thumbnail full URL.