API:Allimages
From MediaWiki.org
| This page is part of the MediaWiki API documentation. |
| Language: | English |
|---|
Quick overview:
- Quick start guide
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Search suggestions
- Expanding templates and rendering
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
| MediaWiki version: | 1.12 |
Returns a list of all images, ordered by image title or by timestamp. Timestamp order was added in MediaWiki 1.20. Only the most recent version of each image is returned.
Parameters [edit]
aisort: Property to sort by MW 1.20+name: Sort results by name (default)timestamp: Sort results by timestamp
aidir: In which direction to listascending: List from A to Z (when aisort=name) or from old to new (when aisort=timestamp) (default)descending: List from Z to A (when aisort=name) or from new to old (when aisort=timestamp)newer: List from A to Z (when aisort=name) or from old to new (when aisort=timestamp) MW 1.20+older: List from Z to A (when aisort=name) or from new to old (when aisort=timestamp) MW 1.20+
aifrom: Start listing at this title. The title doesn't need to exist. Can only be used with aisort=nameaito: Stop listing at this title. The title doesn't need to exist. Can only be used with aisort=nameaiprefix: Only list titles that start with this value. Can only be used with aisort=nameaistart: The timestamp to start enumerating from. Can only be used with aisort=timestamp MW 1.20+aiend: The timestamp to end enumerating. Can only be used with aisort=timestamp MW 1.20+aiminsize: Only list images that are at least this many bytes in sizeaimaxsize: Only list images that are at most this many bytes in sizeailimit: Maximum amount of images to list (10 by default)aisha1: Only list images with this SHA-1 hash. These hashes are supposed to be unique, so you can use this to track duplicates. If you run into two different images with the same hash, you should start playing the lotteryaisha1base36: Same asaisha1, but in base 36aiuser: Only return files uploaded by this user. Can only be used with aisort=timestamp. Cannot be used together with aifilterbots MW 1.20+aifilterbots: How to filter files uploaded by bots. Can only be used with aisort=timestamp. Cannot be used together with aiuser MW 1.20+aiprop: Which properties to gettimestamp: The time and date the most recent version of the image was uploaded (default)user: The name of the user who uploaded the most recent versioncomment: The edit comment for the latest uploadurl: The URL to the most recent version of the image (default)size: The image's size in bytesdimensions: The image's width and height in pixelsmime: The image's MIME typesha1: The image's SHA-1 hashmetadata: Image metadata, if available
Example [edit]
Show a list of first 5 images whose name starts with "Albert"
| Result |
|---|
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <allimages aifrom="Albert-einstein-biography-pictures.jpg" /> </query-continue> <query> <allimages> <img name="Albert's_Real_Jamaican_Foods.JPG" width="1024" height="768" mime="image/jpeg" /> <img name="Albert-Cashier.jpg" width="150" height="220" mime="image/jpeg" /> <img name="Albert-Park-Brisbane-1.jpg" width="936" height="695" mime="image/jpeg" /> <img name="Albert-Park-Brisbane-2.jpg" width="830" height="525" mime="image/jpeg" /> <img name="Albert-Park-railway-station.jpg" width="640" height="480" mime="image/jpeg" /> </allimages> </query> </api> |
| The above content has been placed in a collapsed box for improved usability. |