API:Allimages

From MediaWiki.org
Jump to navigation Jump to search
This page is part of the MediaWiki action API documentation.

MediaWiki action API

v · d · e

Returns a list of all files, ordered by title or by timestamp. Timestamp order was added in MediaWiki 1.20. Only the most recent version of each file is returned.

Parameters[edit]

  • 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 files that are at least this many bytes in size
  • aimaxsize: Only list files that are at most this many bytes in size
  • ailimit: Maximum amount of files to list (Default: 10)
  • aisha1: Only list files 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 files with the same hash, you should report it, since it will be of considerable interest to some people.
  • 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 file was uploaded
    • user: The name of the user who uploaded the most recent version
    • userid: Add the user ID that uploaded the file 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 file 1.23+
    • url: The URL to the most recent version of the file
    • size: The file's size in bytes, its height and its width. Page count and duration are added if applicable
    • dimensions: Alias for size
    • sha1: The file's SHA-1 hash
    • mime: The file's MIME type
    • mediatype: The media type of the file 1.18+
    • metadata: Exif metadata for the file, if any
    • commonmetadata: File format generic metadata for the version of the file 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]

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