API:Lists

Lists differ from properties in two aspects - instead of appending data to the elements in the  element. Also, list output is limited by number of items, and may be continued using the  element. Unless indicated otherwise, all modules listed on this page can be used as a generator.

allpages / ap
Returns a list of pages in a given namespace, ordered by page title.

Parameters

 * : Start listing at this title. The title need not exist
 * : Only list titles that start with this value
 * : The namespace to enumerate. You can only enumerate one namespace at a time. By default, the main namespace will be enumerated
 * : How to filter redirects
 * : List all pages regardless of their redirect flag (default)
 * : Only list redirects
 * : Don't list redirects
 * : How to filter based on whether a page has language links
 * : List all pages regardless of whether they have language links (default)
 * : Only list pages with language links
 * : Only list pages without language links
 * : Only list pages that are at least this many bytes in size
 * : Only list pages that are at most this many bytes in size
 * : Only list pages that have been protected from this type of action
 * : Only list edit-protected pages
 * : Only list move-protected pages
 * Other wikis may allow for more kinds of protection and will therefore provide more options here
 * : Only list pages that have been protected at this level
 * : Only autoconfirmed users can edit/move/whatever
 * : Only sysops can edit/move/whatever
 * Empty: Everyone can edit/move/whatever
 * Other wikis may allow protection on more levels and will therefore provide more options here
 * : Maximum amount of pages to list (10 by default)
 * : In which direction to list
 * : List from A to Z (default)
 * : List from Z to A

alllinks / al
Returns a list of (unique) links to pages in a given namespace starting ordered by link title.

Parameters

 * : Start listing at this title. The title need not exist
 * : Only list links to titles that begin with this value
 * : The namespace to enumerate. You can only enumerate one namespace at a time. By default, the main namespace will be enumerated
 * : If set, multiple links to the same title will be listed only once. Cannot be used in generator mode or with
 * : Maximum amount of links to list (10 by default)
 * : Which properties to return
 * : Page IDs of the linking pages. Cannot be used together with
 * : Link titles (default)

allcategories / ac
Get a list of all categories. This differs from list=allpages&alnamespace=14 in that empty categories aren't listed, and categories without description pages are.

Parameters

 * : Start listing at this category title. The category need not exist
 * : Only list category titles starting with this value
 * : Maximum amount of categories to list (10 by default)
 * : In which direction to list
 * : List from A to Z (default)
 * : List from Z to A

allusers / au
Get a list of registered users, ordered by username. This module cannot be used as a generator.

Parameters

 * : Start listing at this username. The user name need not exist
 * : Only list usernames starting with this value
 * : Only list users in this group
 * Any other group that is defined on the wiki. This is different for every wiki; see the API help or action=paraminfo for a list of possible values
 * : Which properties to return
 * : The number of edits the user has made
 * : A list of all groups the user is in
 * : The date and time of the user's registration
 * : Number of users to list; default is 10.
 * : A list of all groups the user is in
 * : The date and time of the user's registration
 * : Number of users to list; default is 10.

allimages / ai
Returns a list of all images, ordered by image title.

Parameters

 * : Start listing at this title. The title need not exist
 * : Only list titles that start with this value
 * : Only list images that are at least this many bytes in size
 * : Only list images that are at most this many bytes in size
 * : Maximum amount of images to list (10 by default)
 * : In which direction to list
 * : List from A to Z (default)
 * : List from Z to A
 * : 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
 * : Same as, but in base 36
 * : Which properties to get
 * : The time and date the most recent version of the image was uploaded (default)
 * : The URL to the most recent version of the image (default)
 * : The image's size in bytes
 * : The image's width and height in pixels
 * : The image's MIME type
 * : The image's SHA-1 hash

backlinks / bl
Lists pages that link to a given page, similar to Special:Whatlinkshere. Ordered by linking page title.

Parameters

 * : List pages linking to this title. The title need not exist
 * : Only list pages in these namespaces
 * : How to filter redirects
 * : List all pages regardless of their redirect flag (default)
 * : Only list redirects
 * : Don't list redirects
 * : Maximum amount of pages to list (10 by default)
 * : If set, pages linking to  through a redirect will also be listed. See below for more detailed information
 * : Used to continue a previous request

Links through redirects
When the  parameter is set, this module behaves slightly differently. applies to both levels separately: if e.g., at most 10 first-level pages (pages that link to  ) and 10 second-level pages (pages that link to   through a redirect) will be listed. Continuing queries also works differently, as displayed in the following example.

When continuing this request, we see that there are more pages linking to API, and that the other first-level pages are listed again. To progress beyond Berkeley DB, we have to query-continue again and again until we've had all links to API (or increase, of course).

Parameters

 * bkstart: The timestamp to start listing from (optional). If not specified, all blocks before bkend will be listed.
 * bkend: The timestamp to end listing at (optional). If not specified, all blocks later than bkstart will be listed.
 * bkdir: Direction to list in.
 * older: List newest blocks first (default). Note: bkstart has to be later than bkend.
 * newer: List oldest blocks first. Note: bkstart has to be before bkend.
 * bkids: Pipe-separated list of block IDs to list (optional). If not specified, blocks will be listed regardless of ID.
 * bkusers: Pipe-separated list of users to search for (optional). If not specified, blocks for all users will be listed.
 * bklimit: Maximum number of blocks to get. If not specified, 10 blocks will be listed.
 * bkprop: A pipe-separated list of properties to get. The default value is id|user|by|timestamp|expiry|reason|flags
 * id: The ID of the block
 * user: The IP address or username that was blocked
 * by: The user who applied the block
 * timestamp: When the block was applied
 * expiry: When the block will expire
 * reason: The reason for the block
 * range: If an IP range was blocked, the first and last IP the block applies to
 * flags: Flags that apply to the block
 * automatic: Automatically blocked because of an autoblock (see also action=block)
 * anononly: Only anonymous edits are blocked
 * nocreate: Account creation is disabled
 * autoblock: Automatic blocking is enabled for this block
 * noemail: Sending e-mail through the wiki is disabled for the blocked user
 * hidden: This block is hidden from Special:Ipblocklist. Only users with oversight permissions can see these blocks.

categorymembers / cm
List of pages that belong to a given category, ordered by page sort title.

Parameters

 * : The category to enumerate
 * : Only list pages in these namespaces
 * : Start listing at this timestamp
 * : End listing at this timestamp
 * : Property to sort by
 * : The article's sort key (default)
 * : The time the article was added to the category
 * : Direction to sort in
 * : From A to Z or from 2002 to 2024. Note: cmstart has to be before cmend
 * : From Z to A or from 2024 to 2002 Note: cmstart has to be later than cmend
 * : Maximum amount of pages to list (10 by default)
 * : Which properties to get
 * : page ID (default)
 * : page title (default)
 * : sort key
 * : time and date the article was added to the category
 * : Used to continue a previous request

embeddedin / ei
List pages that include a certain page.

Parameters

 * : List pages including this title. The title need not exist
 * : Only list pages in these namespaces
 * : How to filter redirects
 * : List all pages regardless of their redirect flag (default)
 * : Only list redirects
 * : Don't list redirects
 * : Maximum amount of pages to list (10 by default)
 * : Used to continue a previous request

exturlusage / eu
Get a list of pages that link to a certain URL, à la Special:Linksearch

Parameters

 * : The URL to search for, without the protocol.  can be used as a wildcard
 * : Protocol of the URL
 * The options for this parameter vary per wiki. By default, the options are  (default), ,  ,  ,  ,  ,  ,  ,  ,
 * : Only list links from pages in these namespaces
 * : Maximum amount of pages to list (10 by default)
 * : Which properties to get
 * : Page ID of the linking page
 * : Title of the linking page
 * : URL being linked to
 * : Used for continuing a previous request

imageusage / iu
List of pages that include a given image. Ordered by page title.

Parameters

 * : List pages using this image. The image need not exist
 * : Only list pages in these namespaces
 * : How to filter redirects
 * : List all pages regardless of their redirect flag (default)
 * : Only list redirects
 * : Don't list redirects
 * : Maximum amount of pages to list (10 by default)
 * : If set, pages linking to  through a redirect will also be listed. See the documentation for list=backlinks for more detailed information
 * : Used to continue a previous request

logevents / le (semi-complete)

 * List log events, filtered by time range, event type, user type, or the page it applies to. Ordered by event timestamp.
 * Parameters: letype (flt), lestart (paging timestamp), leend (flt), ledirection (dflt=older), leuser (flt), letitle (flt), lelimit (dflt=10, max=500/5000)

api.php ? action=query & list=logevents     - List last 10 events of any type

recentchanges / rc (done)

 * Gets a list of pages recently changed, ordered by modification timestamp.
 * Parameters: rcfrom (paging timestamp), rcto (flt), rcnamespace (flt), rcminor (flt), rcusertype (dflt=not|bot), rcdirection (dflt=older), rclimit (dflt=10, max=500/5000)

api.php ? action=query & list=recentchanges - List last 10 changes

search / sr (done)

 * Full text search in wiki

usercontribs / uc (semi-complete, needs parameter revision)

 * Gets a list of pages modified by a given user, ordered by modification time.
 * Parameters: ucuser, ucfrom (paging timestamp), ucto (flt), ucnamespace (flt), ucminor (flt), uctop (flt), ucdirection (dflt=older), uclimit (dflt=10, max=500/5000)

api.php ? action=query & list=usercontribs & ucuser=UserA  - List last 10 changes made by userA

watchlist / wl (done)

 * Get a list of pages on the user's watchlist but only if they were changed within the given time period. Ordered by time of the last change of the watched page.
 * Parameters: wlfrom (paging timestamp), wlto (flt), wlnamespace (flt), wldirection (dflt=older), wllimit (dflt=10, max=500/5000)

deletedrevs / dr

 * Ideas
 * Expose as part of revisions?

Parameters

 * titles: Pipe-separated list of titles to list deleted revisions for (optional). If not specified, all deleted revisions will be listed.
 * drstart: The timestamp to start listing from (optional). If not specified, all revisions before drend will be listed.
 * drend: The timestamp to end listing at (optional). If not specified, all revisions later than drstart will be listed.
 * drdir: Direction to list in.
 * older: List newest revisions first (default). Note: drstart has to be later than drend.
 * newer: List oldest revisions first. Note: drstart has to be before drend.
 * drnamespace: Pipe-separated list of namespace numbers to search in. By default, all namespaces will be searched.
 * drlimit: Maximum number of revisions to get. If not specified, 10 revisions will be listed.
 * drprop: A pipe-separated list of properties to get. Possible values are revid, user, comment, minor, len, content and token. The default value is user|comment.

Possible errors
All errors are formatted as:
 * code: drpermissiondenied
 * info: You don't have permission to view deleted revisions
 * On most wikis, viewing deleted revisions is restricted to sysops, but other wikis may have stricter rules.

Parameters

 * bkstart: The timestamp to start listing from (optional). If not specified, all blocks before bkend will be listed.
 * bkend: The timestamp to end listing at (optional). If not specified, all blocks later than bkstart will be listed.
 * bkdir: Direction to list in.
 * older: List newest blocks first (default). Note: bkstart has to be later than bkend.
 * newer: List oldest blocks first. Note: bkstart has to be before bkend.
 * bkids: Pipe-separated list of block IDs to list (optional). If not specified, blocks will be listed regardless of ID.
 * bkusers: Pipe-separated list of users to search for (optional). If not specified, blocks for all users will be listed.
 * bklimit: Maximum number of blocks to get. If not specified, 10 blocks will be listed.
 * bkprop: A pipe-separated list of properties to get. The default value is id|user|by|timestamp|expiry|reason|flags
 * id: The ID of the block
 * user: The IP address or username that was blocked
 * by: The user who applied the block
 * timestamp: When the block was applied
 * expiry: When the block will expire
 * reason: The reason for the block
 * range: If an IP range was blocked, the first and last IP the block applies to
 * flags: Flags that apply to the block
 * automatic: Automatically blocked because of an autoblock (see also action=block)
 * anononly: Only anonymous edits are blocked
 * nocreate: Account creation is disabled
 * autoblock: Automatic blocking is enabled for this block
 * noemail: Sending e-mail through the wiki is disabled for the blocked user
 * hidden: This block is hidden from Special:Ipblocklist. Only users with oversight permissions can see these blocks.

Sample request
TODO from here onward