API:Allimages

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

Quick overview:

v · d · e
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 | edit source]

  • aisort: Property to sort by MW 1.20+
    • name: Sort results by name (default)
    • timestamp: Sort results by timestamp
  • aidir: In which direction to list
    • ascending: 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=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 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 size
  • aimaxsize: Only list images that are at most this many bytes in size
  • ailimit: 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 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 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 get
    • timestamp: 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 version
    • comment: The edit comment for the latest upload
    • url: The URL to the most recent version of the image (default)
    • size: The image's size in bytes
    • dimensions: The image's width and height in pixels
    • mime: The image's MIME type
    • sha1: The image's SHA-1 hash
    • metadata: Image metadata, if available

Example[edit | edit source]

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