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?
As other's have mentioned, you would use prop=pageimages in your API query. If you also want the image description, you would use prop=pageimages|pageterms instead in your API query. You can get the original image using piprop=original . Or you can get a thumbnail image with a specified width/height.
Upload an image that you own now. You can log in there using your same Wikipedia user name and password. Click the "upload file" link in the menu to the left. Follow the instructions to upload the file. It's the same procedure as most websites, although we only accept "freely licensed" images.
What is the Wikipedia API? The Wikipedia API (official documentation) is supported by the MediaWiki's API and provide access to Wikipedia and other MediaWiki data without interacting with the user interface.
There are three main methods for retrieving page content via the API: Get the contents of a page using the Revisions API (as wikitext). Get the contents of a page using the Parse API (as HTML or wikitext). Get plain text or limited HTML extracts of a page using the API of the TextExtracts extension.
There's little documentation on image/thumbnail URLs besides T153497. You can use Special:FilePath
and/or thumb.php
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With