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, modules listed on this page can be used as generators.

Limits
All list queries return a limited number of results. This limit is 10 by default, and can be set as high as 500 for regular users, or 5000 for users with the  right (typically bots and sysops). Some modules impose stricter limits under certain conditions. If you're not sure which limit applies to you and just want as many results as possible, set the limit to. In that case, a  element will be returned, specifying the limits used.

Errors

If you set the limit to a value higher than the maximum, an error will be thrown, which looks like: ( can be replaced with any other module prefix)
 * code: aplimit
 * info: aplimit may not be over 500 (set to 1000) for users

Example

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. Cannot be used without
 * : 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

Example

Possible errors
 * code: apparams
 * info: Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator
 * code: apparams
 * info: prlevel may not be used without prtype

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

Parameters
 * : Used to continue a previous request
 * : 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)

Example

Possible errors
 * code: alparams
 * info: alllinks cannot be used as a generator in unique links mode
 * code: alparams
 * info: alllinks cannot return corresponding page ids in unique links mode
 * This happens when you use  and   together
 * code: alparams
 * info: alcontinue and alfrom cannot be used together

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

Example

Possible errors

None

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 (10 by default)
 * : A list of all groups the user is in
 * : The date and time of the user's registration
 * : Number of users to list (10 by default)

Example

Possible errors

None

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 name of the user who uploaded the most recent version
 * : The edit comment for the latest upload
 * : 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
 * : Image metadata, if available

Example

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). Maximum limit is halved if  is set
 * : If set, pages linking to  through a redirect will also be listed. See below for more detailed information
 * : Used to continue a previous request

Example

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).

Possible errors
 * code: blbad_title_count
 * info: The backlinks query requires one title to start
 * This happens when you use  instead of   (this usage is deprecated) and specify multiple titles
 * code: bl_badcontinue
 * info: Invalid continue param. You should pass the original value returned by the previous query

blocks / bk
List all blocks, à la Special:Ipblocklist. This module cannot be used as a generator.

Parameters
 * : The timestamp to start listing from
 * : The timestamp to end listing at
 * : Direction to list in.
 * : List newest blocks first (default). Note: bkstart has to be later than bkend.
 * : List oldest blocks first. Note: bkstart has to be before bkend.
 * : Only list blocks with these IDs
 * : Only list blocks of these users
 * : List all blocks, including range blocks, that apply to this IP address. You can also specify a CIDR range here, in which case only blocks applying to the entire range will be listed. Cannot be used together with . CIDR ranges broader than /16 are not allowed, as range blocks cannot cross /16 boundaries
 * : Maximum number of blocks to list (10 by default)
 * : A pipe-separated list of properties to get. The default value is id|user|by|timestamp|expiry|reason|flags
 * : The ID of the block (default)
 * : The IP address or username that was blocked (default)
 * : The user who applied the block (default)
 * : When the block was applied (default)
 * : When the block will expire (default)
 * : The reason for the block (default)
 * : If an IP range was blocked, the first and last IP the block applies to
 * : Flags that apply to the block (default)
 * : Automatically blocked because of an autoblock (see also action=block)
 * : Only anonymous edits are blocked
 * : Account creation is disabled
 * : Automatic blocking is enabled for this block
 * : Sending e-mail through the wiki is disabled for the blocked user
 * : This block is hidden from Special:Ipblocklist. Only users with oversight permissions can see these blocks.

Example

Possible errors

None.

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. Can only be used with
 * : End listing at this timestamp. Can only be used with
 * : Start listing at this sortkey. Can only be used with
 * : End listing at this sortkey. Can only be used with
 * : 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

Example

Possible errors
 * code: cmnotitle
 * info: The cmtitle parameter is required
 * code: cminvalidcategory
 * info: The category name you entered is not valid
 * code: cmbadcontinue
 * info: Invalid continue param. You should pass the original value returned by the previous query

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

Example

Possible errors
 * code: eibad_title_count
 * info: The embeddedin query requires one title to start
 * This happens when you use  instead of   (this usage is deprecated) and specify multiple titles
 * code: ei_badcontinue
 * info: Invalid continue param. You should pass the original value returned by the previous query

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. If you omit   (not just leave it empty), all external links will be listed, and   will be ignored
 * : 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

Example

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

Example

Possible errors
 * code: iubad_title_count
 * info: The imageusage query requires one title to start
 * This happens when you use  instead of   (this usage is deprecated) and specify multiple titles
 * code: iu_badcontinue
 * info: Invalid continue param. You should pass the original value returned by the previous query
 * code: iubad_image_title
 * info: The title for imageusage query must be an image

logevents / le
Get a list of all logged events, à la Special:Log. This module cannot be used as a generator.

Parameters
 * : Which properties to get
 * : Page ID of the page in question and log ID (default)
 * : Title of the page in question (default)
 * : Type of log entry (default)
 * : User responsible for the log entry (default)
 * : Time and date the log entry was created (default)
 * : Log comment (default)
 * : Extra information (not present for all log types) (default)
 * : Only list log entries of this type
 * Extensions may add other log types
 * : Only list log entries made by this user
 * : Only list log entries related to this title
 * : The timestamp to start listing from
 * : The timestamp to end listing at
 * : Direction to list in
 * : List newest log entries first (default). Note:  has to be later than  .
 * : List oldest log entries first. Note:  has to be before  .
 * : Maximum amount of log entries to list (10 by default)
 * Extensions may add other log types
 * : Only list log entries made by this user
 * : Only list log entries related to this title
 * : The timestamp to start listing from
 * : The timestamp to end listing at
 * : Direction to list in
 * : List newest log entries first (default). Note:  has to be later than  .
 * : List oldest log entries first. Note:  has to be before  .
 * : Maximum amount of log entries to list (10 by default)

Example

Possible errors
 * code: leparam_user
 * info: User name username not found
 * code: leparam_title
 * info: Bad title value ' title '
 * This happens when you set  to an invalid title

recentchanges / rc
Get all recent changes to the wiki, à la Special:Recentchanges. This module cannot be used as a generator.

Parameters
 * : The timestamp to start listing from
 * : The timestamp to end listing at
 * : Direction to list in
 * : List newest changes first (default). Note:  has to be later than  .
 * : List oldest changes first. Note:  has to be before  .
 * : Maximum amount of changes to list (10 by default)
 * : Only list changes in these namespaces
 * : Only list changes to these titles
 * : Only list changes made by this user
 * : Do not list changes made by this user
 * : Only list certain types of changes
 * : Regular page edits
 * : Page creations
 * : Log entries
 * : Only list items that meet these criteria. Conflicting options (such as  and  ) cannot be used together
 * : Only list minor edits
 * : Don't list minor edits
 * : Only list bot edits
 * : Don't list bot edits
 * : Only list edits by anonymous users
 * : Only list edits by registered users
 * : Only list edits to pages that are currently redirects
 * : Only list edits to pages that currently aren't redirects
 * : Only list edits flagged as patrolled. Only available to users with the  right
 * : Only list edits not flagged as patrolled. Only available to users with the  right
 * : Which properties to get
 * : The user who made the change
 * : The edit/log comment
 * : The time and date of the change (default)
 * : The title the change was made to (default)
 * : The page ID, revision ID, previous revision ID and RCID (used for patrolling) (default)
 * : The page size before and after the change
 * : Whether the changed page is currently a redirect
 * : Whether the change is patrolled. Only available to users with the  right
 * : If the change was a log event, add the,   and   fields and the log parameters
 * : A new page was created
 * : The change was a minor edit
 * : The change was a bot edit
 * : The change was a bot edit

Example

Possible warnings
 * Action ' action ' is not allowed for the current user
 * Thrown when a token is requested that the current user isn't allowed to use

Possible errors
 * code: rcshow
 * info: Incorrect parameter - mutually exclusive values may not be supplied
 * code: rcpermissiondenied
 * info: You need the patrol right to request the patrolled flag

search / sr
Search for a string in all articles à la Special:Search

Parameters
 * : The string to search for
 * : Where to search in
 * : Search in page titles (default) (falls back to text if search engine doesn't support title searches, as on Wikipedia)
 * : Search in page text
 * : Only search in these namespaces. By default, only the main namespace is searched
 * : Also list redirects
 * : Maximum amount of pages to list (10 by default)
 * : Used to continue a previous request

Example

Possible errors
 * code: srparam-search
 * info: empty search string is not allowed
 * code: srsearch-title-disabled
 * info: title search is disabled
 * code: srsearch-text-disabled
 * info: text search is disabled

usercontribs / uc
Gets a list of contributions made by a given user, ordered by modification time. This module cannot be used as a generator.

Parameters
 * : User to retrieve contributions for
 * : List contributions of all users whose name starts with this string. Overrides
 * This is useful for getting contributions of IP ranges.
 * Note that contributions will be sorted by user first, then by timestamp, when using this option
 * : The timestamp to start listing from
 * : The timestamp to end listing at
 * : When more results are available, use this to continue
 * : Direction to list in
 * : List newest contributions first (default). Note:  has to be later than  .
 * If using, users will be listed in descending order (Z to A)
 * : List oldest contributions first. Note:  has to be before  .
 * If using, users will be listed in ascending order (A to Z)
 * : Maximum amount of contributions to list (10 by default)
 * : Only list contributions in these namespaces
 * : Only list contributions that meet these criteria. Conflicting options (such as  and  ) cannot be used together
 * : Only list minor edits
 * : Don't list minor edits
 * : Only list patrolled edits. Only available to users with the  right
 * : Only list non-patrolled edits. Only available to users with the  right
 * If  or   is used, revisions older than $wgRCMaxAge will not be shown.
 * : Which properties to get
 * : Page ID and revision ID
 * : Title of the page that was changed
 * : Time and date of the contribution
 * : Edit/log comment
 * : Whether the change is patrolled. Only available to users with the  right
 * : A new page was created
 * : The change was a minor edit
 * : The change was a bot edit
 * : This is the latest version of the article
 * : This is the latest version of the article

Example

Possible errors
 * code: ucparam_user
 * info: User name username is not valid
 * code: ucparam_user
 * info: User parameter may not be empty
 * code: ucshow
 * info: Incorrect parameter - mutually exclusive values may not be supplied
 * code: permissiondenied
 * info: You need the patrol right to request the patrolled flag

watchlist / wl
Get a list of pages on the current user's watchlist that were changed within the given time period. Ordered by time of the last change of the watched page.

Parameters
 * : The timestamp to start listing from
 * : The timestamp to end listing at
 * : Direction to list in
 * : List most recently changed pages first (default). Note:  has to be later than  .
 * : List least recently changed pages first. Note:  has to be before  .
 * : Maximum amount of pages to list (10 by default)
 * : Only list pages in these namespaces
 * : Only list changes made by this user
 * : Do not list changes made by this user
 * : Include multiple revisions to the same page. This parameter cannot be used in generator mode
 * : Only list revisions that meet these criteria. Conflicting options (such as  and  ) cannot be used together
 * : Only list minor edits
 * : Don't list minor edits
 * : Only list bot edits
 * : Don't list bot edits
 * : Only list edits by anonymous users
 * : Only list edits by registered users
 * : Which properties to get
 * : The user who made the change
 * : The edit/log comment
 * : The time and date of the change
 * : The title the change was made to (default)
 * : The page ID, revision ID, previous revision ID and RCID (used for patrolling) (default)
 * : The page size before and after the change
 * : Whether the change is patrolled. Only available to users with the  right
 * : (default)
 * : A new page was created
 * : The change was a minor edit
 * : The change was a bot edit

Example

Possible errors
 * code: wlnotloggedin
 * info: You must be logged-in to have a watchlist
 * code: wlpatrol
 * info: patrol property is not available
 * code: wlshow
 * info: Incorrect parameter - mutually exclusive values may not be supplied

deletedrevs / dr

 * NOTE: This module's behavior was changed significantly in MediaWiki 1.15. Some of the features described here are not available in MediaWiki 1.14 and earlier.

List deleted revisions. You need the  right to use this module. This module cannot be used as a generator. This module can be used in one of three modes: Some parameters are restricted to certain modes only, and are marked accordingly. For instance, a parameter marked (1,2) only applies to modes 1 and 2 and is ignored in mode 3.
 * 1) List deleted revisions for the given titles (through   or a generator), sorted by timestamp
 * 2) List deleted contributions for a certain user, sorted by timestamp (  set, no titles given)
 * 3) List all deleted revisions in a certain namespace (  not set, no titles given)

Parameters
 * : Maximum number of revisions to list (10 by default)
 * : Only list revisions by this user
 * : Don't list revisions by this user
 * : The timestamp to start listing from (optional). If not specified, all revisions before drend will be listed. (1,2)
 * : The timestamp to end listing at (optional). If not specified, all revisions later than drstart will be listed. (1,2)
 * : Direction to list in. (1,2)
 * : List newest revisions first (default). Note: drstart has to be later than drend.
 * : List oldest revisions first. Note: drstart has to be before drend.
 * : List all deleted revisions in this namespace (3)
 * : List only one revision for each page (3)
 * : Start listing at this title (3)
 * : When more results are available, use this to continue (3)
 * : Which properties to get
 * : Revision ID
 * : User who made the edit (default)
 * : Edit comment (default)
 * : Whether the edit was minor
 * : Revision size
 * : Revision content. You need the  right to use this option
 * : Undelete token

Sample request

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

users / us
Get information about a list of users. This module cannot be used as a generator.

Parameters
 * : A list of user names to get information for
 * : Which tokens to get
 * : Token for changing a user's group membership
 * : Which properties to get
 * : Whether the user is blocked, by whom and why
 * : All groups the user belongs to
 * : The number of edits the user has made
 * : The time and date the user registered at
 * : Whether the user can and wants to receive e-mail through Special:Emailuser

Example

Possible errors

None

random / rn
Get a list of random pages.

Pages are listed in a fixed sequence, only the starting point is random. This means that if, for example, "Main Page" is the first random page on your list, "List of fictional monkeys" will always be second, "List of people on stamps of Vanuatu" third, etc.

Parameters
 * : Maximum number of pages to return (1 by default)
 * If the number of pages in the namespace is lower than, you will get fewer pages. You will not get the same page twice.
 * : Only list pages in these namespaces
 * : Only list redirects
 * By default, only non-redirects are listed

Example

Possible errors

None

protectedtitles / pt
Get a list of titles protected from creation.

Parameters
 * : Start listing at this protection timestamp
 * : End listing at this protection timestamp
 * : Direction to list in
 * : List most recently protected titles first (default). Note: ptstart has to be later than ptend.
 * : List least recently protected titles first Note: ptstart has to be before ptend.
 * : Maximum number of titles to return (10 by default)
 * : Only list titles in these namespaces
 * : Only list titles with this protection level
 * : A pipe-separated list of properties to get
 * : Timestamp the title was protected (default)
 * : User who protected the title
 * : Protection log comment
 * : Expiry timestamp
 * : Protection level (i.e. the right needed to be able to create the page) (default)

Example

Possible errors

None