API:Allimages

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki API documentation.
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.13

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 | edit source]

  • aisort: Property to sort by (Default: name) 1.20+
    • name: Sort results by name
    • timestamp: Sort results by timestamp
  • aidir: In which direction to list (Default: ascending)
    • ascending: List from A to Z (when aisort=name) or from old to new (when aisort=timestamp)
    • 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) 1.20+
    • older: List from Z to A (when aisort=name) or from new to old (when aisort=timestamp) 1.20+
  • aifrom: Start listing at this title. The title doesn't need to exist. Can only be used with aisort=name
  • aito: Stop listing at this title. The title doesn't need to exist. Can only be used with aisort=name
  • aiprefix: Only list titles that start with this value. Can only be used with aisort=name
  • aistart: The timestamp to start enumerating from. Can only be used with aisort=timestamp 1.20+
  • aiend: The timestamp to end enumerating. Can only be used with aisort=timestamp 1.20+
  • aiminsize: Only list images that are at least this many bytes in size
  • aimaxsize: Only list images that are at most this many bytes in size
  • ailimit: Maximum amount of images to list (Default: 10)
  • 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 lottery
  • aisha1base36: Same as aisha1, but in base 36
  • aiuser: Only return files uploaded by this user. Can only be used with aisort=timestamp. Cannot be used together with aifilterbots 1.20+
  • aifilterbots: How to filter files uploaded by bots. Can only be used with aisort=timestamp. Cannot be used together with aiuser. Possible values: all, bots, nobots. 1.20+
  • aiprop: Which properties to get (Default: timestamp|url)
    • timestamp: The time and date the most recent version of the image was uploaded
    • user: The name of the user who uploaded the most recent version
    • userid: Add the user ID that uploaded the image version 1.17+
    • comment: The edit comment for the latest upload
    • parsedcomment: Parse the comment on the version 1.17+
    • canonicaltitle: Adds the canonical title of the image file 1.23+
    • url: The URL to the most recent version of the image
    • size: The image's size in bytes, its height and its width. Page count and duration are added if applicable
    • dimensions: Alias for size
    • sha1: The image's SHA-1 hash
    • mime: The image's MIME type
    • mediatype: The media type of the image 1.18+
    • metadata: Exif metadata for the version of the image
    • commonmetadata: File format generic metadata for the version of the image 1.23+
    • extmetadata: Formatted metadata combined from multiple sources. Results are HTML formatted. 1.23+
    • bitdepth: The bit depth of the version 1.14+
  • aimime: What MIME type to search for. e.g. image/jpeg. Disabled in Miser Mode 1.18+

Example[edit | edit source]

Show a list of first 5 images whose name starts with "Albert"