API:Lists/All

From MediaWiki.org
Jump to: navigation, search

Ugly but useful view of all lists pages combined.

Contents

Allcategories[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.8

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

  • acfrom: The category to start enumerating from
  • acto: The category to stop enumerating at
  • acprefix: Search for all category titles that begin with this value
  • acdir: Direction to sort in
    • ascending: List from A to Z (default)
    • descending: List from Z to A
  • acmin: Minimum number of category members
  • acmax: Maximum number of category members
  • aclimit: How many categories to return. No more than 500 (5000 for bots) allowed. Default: 10
  • acprop: Which properties to get (separate with '|'). No default value
    • size: Adds number of pages in the category
    • hidden: Tags categories that are hidden with __HIDDENCAT__

Example[edit | edit source]

List the first 10 categories whose name starts with "List of"

Error Codes[edit | edit source]

None

Allimages[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • 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"

Alllinks[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.11

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

Parameters[edit | edit source]

  • alcontinue: Used to continue a previous request
  • alfrom: Start listing at this title. The title need not exist
  • alprefix: Only list links to titles that begin with this value
  • alnamespace: The namespace to enumerate. You can only enumerate one namespace at a time. By default, the main namespace will be enumerated
  • alunique: If set, multiple links to the same title will be listed only once. It cannot be used with alprop=ids. When used as a generator, yields target pages instead of source pages. Before MW 1.21 (gerrit:40559) it couldn't be used in generator mode.
  • allimit: Maximum amount of links to list (10 by default)
  • alprop: Which properties to return
    • ids: Page IDs of the linking pages. Cannot be used together with alunique
    • title: Link titles (default)

Example[edit | edit source]

List all links to talk pages whose name starts with Talk:API

Error Codes[edit | edit source]

  • 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 alunique and alprop=ids together
  • code: alparams
    • info: alcontinue and alfrom cannot be used together

Allpages[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.9

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

Parameters[edit | edit source]

  • apfrom: Start listing at this title. The title need not exist
  • apprefix: Only list titles that start with this value
  • apnamespace: The id of the namespace to enumerate (see API:Meta to get the list and the ids of the namespaces). You can only enumerate one namespace at a time. By default, the main namespace will be enumerated
  • apfilterredir: How to filter redirects
    • all: List all pages regardless of their redirect flag (default)
    • redirects: Only list redirects
    • nonredirects: Don't list redirects
  • apfilterlanglinks: How to filter based on whether a page has language links
    • all: List all pages regardless of whether they have language links (default)
    • withlanglinks: Only list pages with language links
    • withoutlanglinks: Only list pages without language links
  • apminsize: Only list pages that are at least this many bytes in size
  • apmaxsize: Only list pages that are at most this many bytes in size
  • apprtype: Only list pages that have been protected from this type of action
    • edit: Only list edit-protected pages
    • move: Only list move-protected pages
    • Other wikis may allow for more kinds of protection and will therefore provide more options here
  • apprlevel: Only list pages that have been protected at this level. Cannot be used without apprtype
    • autoconfirmed: Only autoconfirmed users can edit/move/whatever
    • sysop: 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
  • aplimit: Maximum amount of pages to list. Default 10, must be between 1 and 500.
  • apdir: In which direction to list
    • ascending: List from A to Z (default)
    • descending: List from Z to A

Example[edit | edit source]

Show a list of first 5 pages starting from "Kre"

Show a list of first 3 categories (Namespace id = 14) starting at Ab...

Error Codes[edit | edit source]

  • Unrecognized parameter
    • info: when using allpages as a generator instead of just a list, add a g to the start of its parameter names. E.g. "gapnamespace" instead of "apnamespace"
  • 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

See also[edit | edit source]

Alltransclusions[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.21

List all transclusions (pages embedded using {{x}}), including non-existing.

This module is part of API:Alllinks.

Added in gerrit:40559.

Parameters[edit | edit source]

  • atcontinue: When more results are available, use this to continue.
  • atfrom: The title of the transclusion to start enumerating from.
  • atto: The title of the transclusion to stop enumerating at.
  • atprefix: Search for all transclusion titles that begin with this value.
  • atunique: Only show distinct transclusion titles. Cannot be used with atprop=ids. When used as a generator, yields target pages instead of source pages.
  • atprop: What pieces of information to include.
    • title: Adds the title of the transclusion (default)
    • ids: Adds the pageid of the transcluding page (Cannot be used with atunique).
  • atnamespace: The namespace number to enumerate. Default: 10 (the Template: namespace).
  • atlimit: How many total items to return. Default: 10.
  • atdir: The direction in which to list
    • ascending: List from A to Z (default).
    • descending: List from Z to A.

Example[edit | edit source]

To count the number of pages which transclude a template, to decide to protect it above a certain number.

List all links to talk pages whose name starts with Talk:API

Allusers[edit | edit source]

MediaWiki version: 1.11
Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e

Parameters[edit | edit source]

  • from – The user name to start enumerating from
  • to – The user name to stop enumerating at
  • prefix – Search for all users that begin with this value
  • dir – Direction to sort in. One value: ascending, descending. Default: ascending
  • group – Limit users to given group name(s). Values (separate with '|'): bot, sysop, bureaucrat ..
    + 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
  • excludegroup – Exclude users in given group name(s)
  • rights – Limit users to given right(s)
  • prop – What pieces of information to include. Values (separate with '|')
    • blockinfo - Adds the information about a current block on the user
    • groups - Lists groups that the user is in. This uses more server resources and may return fewer results than the limit
    • implicitgroups - Lists all the groups the user is automatically in
    • rights - Lists rights that the user has
    • editcount - Adds the edit count of the user
    • registration - Adds the timestamp of when the user registered if available (may be blank)
  • limit – How many total user names to return. No more than 500 (5000 for bots) allowed. Default: 10
  • witheditsonly – Only list users who have made edits
  • activeusers – Only list users active in the last 30 days(s)

Example[edit | edit source]

Show a list of usernames starting with Y (or whichever sorts first after that)

Show a list of first 5 sysops

Error Codes[edit | edit source]

None

Backlinks[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.9

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

Parameters[edit | edit source]

  • bltitle: List pages linking to this title. The title does not need to exist
  • blnamespace: Only list pages in these namespaces
  • blfilterredir: How to filter redirects
    • all: List all pages regardless of their redirect flag (default)
    • redirects: Only list redirects
    • nonredirects: Don't list redirects
  • bllimit: Maximum amount of pages to list (10 by default). Maximum limit is halved if blredirect is set
  • blredirect: If set, pages linking to bltitle through a redirect will also be listed. See below for more detailed information
  • blcontinue: Used to continue a previous request

Example[edit | edit source]

Find all pages that redirect to en:Main Page.

Other links[edit | edit source]

Links through redirects[edit | edit source]

MediaWiki version: 1.12

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

Get a list of pages linking to Albert Einstein (note: the initial query includes a "blcontinue" parameter for purposes of illustration)

When continuing this request, we see that there are more pages linking to Einstein, and that some of the other first-level pages are listed again. If we continue this query again, the same first-level pages will be listed in the next response, as well. To progress beyond Energy, we have to query-continue again and again until we've had all links to Einstein (or increase bllimit, of course). Continuing the previous request:

Links through transclusions[edit | edit source]

If you need to list pages as they appear in "What links here" on the MediaWiki sites with pages transcluding the desired page, you might want to try API:Embeddedin list.

Links through image usage[edit | edit source]

If you need to list pages as they appear in "What links here" on the MediaWiki sites with pages displaying the desired file, you might want to try API:Imageusage list. This also works on non-existent files.

Error Codes[edit | edit source]

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

Blocks[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.12

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

Parameters[edit | edit source]

  • bkstart: The timestamp to start listing from
  • bkend: The timestamp to end listing at
  • 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: Only list blocks with these IDs
  • bkusers: Only list blocks of these users
  • bkip: 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 bkusers. CIDR ranges broader than /16 are not allowed, as range blocks cannot cross /16 boundaries
  • bklimit: Maximum number of blocks to list (10 by default)
  • bkprop: A pipe-separated list of properties to get. They appear as keys of returned dictionary. The default value is id|user|by|timestamp|expiry|reason|flags
    • id: The ID of the block (default)
    • user: The IP address or username that was blocked (default)
      Will not be present as key on autoblock.
    • userid: The id of user who was blocked
      Will not be present as key on autoblock.
    • by: The user who applied the block (default)
    • byid: The id of user who applied the block
    • timestamp: When the block was applied (default)
    • expiry: When the block will expire (default)
      Returns a timestamp for finite blocks and 'infinity' for infinite/indefinite ones.
    • reason: The reason for the block (default)
    • range: If an IP range was blocked, the first and last IP the block applies to
      Will appear as rangestart and rangeend in the answer, both 0.0.0.0 for registered users. Same as user for standalone IPs.
    • flags: Flags that apply to the block (default)
      The appropriate flags will appear as keys of returned dictionary with an empty value. No key if the flag is not valid for 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
      • allowusertalk: The user is allowed to edit his/her own talk page
      • hidden: This block is hidden from Special:Ipblocklist. Only users with oversight permissions can see these blocks.

Example[edit | edit source]

Listing the 3 most recent blocks

Error Codes[edit | edit source]

None.

Categorymembers[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.11

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

Parameters[edit | edit source]

  • cmtitle: The category to enumerate (required). Must include Category: prefix. Cannot be used together with cmpageid.
  • cmpageid: Page ID of the category to enumerate. Cannot be used together with cmtitle.
  • cmnamespace: Only list pages in these namespaces
  • cmtype: Type of category members to include (page, subcat or file; separate with '|'). Ignored when cmsort=timestamp is set. Default: page|subcat|file
  • cmstart: Start listing at this timestamp. Can only be used with cmsort=timestamp
  • cmend: End listing at this timestamp. Can only be used with cmsort=timestamp
  • cmstartsortkey: Start listing at this hexadecimal sortkey. Can only be used with cmsort=sortkey
  • cmendsortkey: End listing at this hexadecimal sortkey. Can only be used with cmsort=sortkey
  • cmstartsortkeyprefix: Start listing at this sortkey prefix. Can only be used with cmsort=sortkey. Overrides cmstartsortkey
  • cmendsortkeyprefix: End listing before (not at) this sortkey prefix (if this value occurs it will not be included). Can only be used with cmsort=sortkey. Overrides cmendsortkey
  • cmsort: Property to sort by
    • sortkey: The article's sort key (default)
    • timestamp: The time the article was added to the category (or the categorization, i.e. the sortkey, was changed)
  • cmdir: Direction to sort in
    • asc: From A to Z or from 2002 to 2014. Note: cmstart has to be before cmend
    • desc: From Z to A or from 2014 to 2002 Note: cmstart has to be later than cmend
  • cmlimit: Maximum number of pages to list (10 by default, "max" provides all members (up to 500 for normal accounts, 5000 for bot accounts))
  • cmprop: Which properties to get (separate with '|'). Default: ids|title
    • ids: page ID (default)
    • title: page title (default)
    • sortkey: the sortkey used for sorting in the category (hexadecimal string)
    • sortkeyprefix: the sortkey prefix used for sorting in the category (human-readable part of the sortkey)
    • type: type that the page has been categorised as (page, subcat or file) MW 1.18+
    • timestamp: time and date the article was added to the category
  • cmcontinue: Used to continue a previous request. Format of cmcontinue is "type|hexsortkey|pageid". When used to continue query then new cmstartsortkey value is decoded value of hexsortkey.

Example[edit | edit source]

Get the 10 articles most recently added to Category:Physics

Error Codes[edit | edit source]

  • 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

Retrieving via AJAX[edit | edit source]

Below is sample code for retrieving the category list via an Ajax request:

function asyncGetCategoryList( categoryName ) {
    $.ajax({
        url: mw.util.wikiScript( 'api' ),
        data: {
            // For parameter documentation, visit <http://en.wikipedia.org/w/api.php> and then search for "list=categorymembers"
            format: 'json',
            action: 'query',
            list: 'categorymembers',
            cmtitle: 'Category:' + categoryName,
            cmtype: 'subcat',
        },
        dataType: 'json',
        type: 'GET',
        success: function( data ) {
            if ( data && data.query && data.query.categorymembers ) {
                // ... success ...
            } else if ( data && data.error ) {
                // Will this ever happen??
                alert( 'Error: API returned error code "' + data.error.code + '": ' + data.error.info );
            } else {
                alert( 'Error: Unknown result from API.' );
            }
        },
        error: function( xhr ) {
            // ... error ...
        }
    });
}

deletedrevs[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.12
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 deletedhistory right to use this module. This module cannot be used as a generator. This module can be used in one of three modes:

  1. List deleted revisions for the given titles (through titles or a generator), sorted by timestamp
  2. List deleted contributions for a certain user, sorted by timestamp (druser set, no titles given)
  3. List all deleted revisions in a certain namespace (druser not set, no titles given)

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.

Parameters[edit | edit source]

  • drlimit: Maximum number of revisions to list (10 by default)
  • druser: Only list revisions by this user
  • drexcludeuser: Don't list revisions by this user
  • drstart: The timestamp to start listing from (optional). If not specified, all revisions before drend will be listed. (1,2)
  • drend: The timestamp to end listing at (optional). If not specified, all revisions later than drstart will be listed. (1,2)
  • drdir: Direction to list in. (1,2)
    • 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: List all deleted revisions in this namespace (3)
  • drunique: List only one revision for each page (3)
  • drfrom: Start listing at this title (3)
  • drcontinue: When more results are available, use this to continue (3) Note: may only work if drdir is set to newer.
  • drprop: Which properties to get
    • revid: Revision ID
    • user: User who made the edit (default)
    • comment: Edit comment (default)
    • minor: Whether the edit was minor
    • len: Revision size
    • content: Revision content. You need the undelete right to use this option
    • token: Undelete token

Examples[edit | edit source]

Listing the 8 most recent deleted revisions dated September 4, 2007 (mode 3).

Error Codes[edit | edit source]

  • 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

Embeddedin[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.9

List pages that transclude a certain page.

Parameters[edit | edit source]

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

Example[edit | edit source]

Find all pages that embed en:template:Stub.

Error Codes[edit | edit source]

  • code: eibad_title_count
    • info: The embeddedin query requires one title to start
      • This happens when you use titles instead of eititle (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[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.11

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

Parameters[edit | edit source]

  • euquery: The URL to search for, without the protocol. * can be used as a wildcard. If you omit euquery (not just leave it empty), all external links will be listed, and euprotocol will be ignored
  • euprotocol: Protocol of the URL
    • The options for this parameter vary per wiki. By default, the options are http (default), https, ftp, irc, gopher, telnet, nntp, worldwind, mailto, news
  • eunamespace: Only list links from pages in these namespaces
  • eulimit: Maximum amount of pages to list (10 by default, can be no larger than 500)
  • euprop: Which properties to get
    • ids: Page ID of the linking page
    • title: Title of the linking page
    • url: URL being linked to
  • euoffset: Used for continuing a previous request

Example[edit | edit source]

Get a list of pages linking to slashdot.org

imageusage / iu[edit | edit source]

MediaWiki version: 1.11

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

Parameters[edit | edit source]

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

Example[edit | edit source]

Find all pages that use Image:Albert Einstein Head.jpg

Error Codes[edit | edit source]

  • code: iubad_title_count
    • info: The imageusage query requires one title to start
      • This happens when you use titles instead of iutitle (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

Filearchive[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.17
  • Prefix: fa
  • Required Rights: None
  • POST Only? No

Enumerate all deleted files sequentially

Parameters[edit | edit source]

  • dir – The direction in which to list.
Type: one of ascending, descending
  • from – The image title to start enumerating from. Type: string
  • limit – How many total images to return. Type: limit
  • maxsize – Limit to images with at most this many bytes. Type: integer
  • minsize – Limit to images with at least this many bytes. Type: integer
  • prefix – Search for all image titles that begin with this value. Type: string
  • prop – What image information to get: sha1 - Adds sha1 hash for the image timestamp - Adds timestamp for the uploaded version user - Adds user for uploaded the image version size - Adds the size of the image in bytes dimensions - Adds the height and width of the image description - Adds description the image version mime - Adds MIME of the image metadata - Lists EXIF metadata for the version of the image bitdepth - Adds the bit depth of the version.
Type: one of sha1, timestamp, user, size, dimensions, description, mime, metadata, bitdepth
  • sha1 – SHA1 hash of image. Overrides fasha1base36. Type: string
  • sha1base36 – SHA1 hash of image in base 36 (used in MediaWiki). Type: string

Errors Codes[edit | edit source]

  • invalidtitle – Bad title ``key''.
  • invalidtitle – Bad title ``title''.
  • permissiondenied – You don't have permission to view deleted file information.
  • readapidenied – You need read permission to use this module.

Imageusage[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
  • Prefix: iu
  • Required Rights: None
  • POST Only? No

Find all pages that use the given image title.

Parameters[edit | edit source]

  • continue – When more results are available, use this to continue. Type: string
  • filterredir – How to filter for redirects. If set to nonredirects when iuredirect is enabled, this is only applied to the second level.
Type: one of all, redirects, nonredirects
  • limit – How many total pages to return. If iuredirect is enabled, limit applies to each level separately (which means you may get up to 2 * limit results).. Type: limit
  • namespace – The namespace to enumerate. Type: namespace
  • redirect – If linking page is a redirect, find all pages that link to that redirect as well. Maximum limit is halved.. Type: bool
  • title (required) – Title to search. Type: string

Errors Codes[edit | edit source]

  • _badcontinue – Invalid continue param. You should pass the original value returned by the previous query.
  • bad_image_title – The title for imageusage query must be an image.
  • invalidtitle – Bad title ``title''.
  • invalidtitle – Bad title ``key''.
  • invalidtitle – Bad title ``title''.
  • notitle – The title parameter must be set.
  • readapidenied – You need read permission to use this module.

Iwbacklinks[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
  • Prefix: iwbl
  • Required Rights: None
  • POST Only? No

Find all pages that link to the given interwiki link. Can be used to find all links with a prefix, or all links to a title (with a given prefix). Using neither parameter is effectively "All IW Links".

Parameters[edit | edit source]

  • continue – When more results are available, use this to continue. Type: string
  • limit – How many total pages to return. Type: limit
  • prefix – Prefix for the interwiki. Type: string
  • prop – Which properties to get iwprefix - Adds the prefix of the interwiki iwtitle - Adds the title of the interwiki.
Type: one of iwprefix, iwtitle
  • title – Interwiki link to search for. Must be used with iwblprefix. Type: string

Errors Codes[edit | edit source]

  • _badcontinue – Invalid continue param. You should pass the original value returned by the previous query.
  • invalidtitle – Bad title ``key''.
  • invalidtitle – Bad title ``title''.
  • noprefix – The prefix parameter must be set.
  • readapidenied – You need read permission to use this module.

Langbacklinks[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
  • Prefix: lbl
  • Required Rights: None
  • POST Only? No

Find all pages that link to the given language link. Can be used to find all links with a language code, or all links to a title (with a given language). Using neither parameter is effectively "All Language Links".

Parameters[edit | edit source]

  • continue – When more results are available, use this to continue. Type: string
  • limit – How many total pages to return. Type: limit
  • lang – Language for the language link. Type: string
  • prop – Which properties to get lllang - Adds the language code of the language link lltitle - Adds the title of the language link.
Type: one of iwprefix, iwtitle
  • title – Language link to search for. Must be used with lbllang. Type: string
  • dir – The direction in which to list. Type: string

Errors Codes[edit | edit source]

  • badcontinue – Invalid continue param. You should pass the original value returned by the previous query.
  • invalidtitle – Bad title ``key''.
  • invalidtitle – Bad title ``title''.
  • nolang – The lang parameter must be set.
  • readapidenied – You need read permission to use this module.

Logevents[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.11

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

Parameters[edit | edit source]

  • leprop: Which properties to get
    • ids: Page ID of the page in question and log ID (default)
    • title: Title of the page in question (default)
    • type: Type of log entry (default)
    • user: User responsible for the log entry (default)
    • userid: The user ID who was responsible for the log event
    • timestamp: Time and date the log entry was created (default)
    • comment: Log comment (default)
    • parsedcomment: The parsed comment of the event
    • details: Extra information (not present for all log types) (default)
    • tags: List tags for the event
  • letype: Only list log entries of this type
    • block
    • protect
    • rights
    • delete
    • upload
    • move
    • import
    • patrol
    • merge
    • newusers
    • Extensions may add other log types
  • leaction: Filter log actions to only this type. Overrides letype even if the action isn't related to letype.
    • block/block
    • block/unblock
    • block/reblock
    • protect/protect
    • protect/modify
    • protect/unprotect
    • protect/move_prot
    • rights/rights
    • rights/autopromote
    • upload/upload
    • upload/overwrite
    • upload/revert
    • import/upload
    • import/interwiki
    • merge/merge
    • suppress/block
    • suppress/reblock
    • review/approve
    • review/approve2
    • review/approve-i
    • review/approve2-i
    • review/approve-a
    • review/approve2-a
    • review/approve-ia
    • review/approve2-ia
    • review/unapprove
    • review/unapprove2
    • rights/erevoke
    • gblblock/gblock
    • gblblock/gblock2
    • gblblock/gunblock
    • gblblock/whitelist
    • gblblock/dwhitelist
    • gblblock/modify
    • globalauth/delete
    • globalauth/lock
    • globalauth/unlock
    • globalauth/hide
    • globalauth/unhide
    • globalauth/lockandhid
    • globalauth/setstatus
    • suppress/setstatus
    • gblrights/usergroups
    • gblrights/groupperms
    • gblrights/groupprms2
    • gblrights/groupprms3
    • suppress/hide-afl
    • suppress/unhide-afl
    • moodbar/hide
    • moodbar/restore
    • moodbar/feedback
    • move/move
    • move/move_redir
    • delete/delete
    • delete/restore
    • delete/revision
    • delete/event
    • suppress/revision
    • suppress/event
    • suppress/delete
    • patrol/patrol
    • stable/config
    • stable/modify
    • stable/reset
    • renameuser/renameuser
    • gblrights/newset
    • gblrights/setrename
    • gblrights/setnewtype
    • gblrights/setchange
    • gblrights/deleteset
    • abusefilter/modify
    • abusefilter/hit
    • suppress/oversight
    • suppress/unoversight
    • suppress/decline
    • suppress/request
    • suppress/unrequest
    • articlefeedbackv5/hidden
    • articlefeedbackv5/unhidden
    • articlefeedbackv5/flag
    • articlefeedbackv5/unflag
    • articlefeedbackv5/autoflag
    • articlefeedbackv5/autohide
    • articlefeedbackv5/feature
    • articlefeedbackv5/unfeature
    • articlefeedbackv5/resolve
    • articlefeedbackv5/unresolve
    • articlefeedbackv5/helpful
    • articlefeedbackv5/unhelpful
    • articlefeedbackv5/undo-helpful
    • articlefeedbackv5/undo-unhelpful
    • articlefeedbackv5/clear-flags
    • pagetriage-curation/reviewed
    • pagetriage-curation/unreviewed
    • pagetriage-curation/tag
    • pagetriage-curation/delete
    • pagetriage-deletion/delete
    • newusers/newusers
    • newusers/create
    • newusers/create2
    • newusers/autocreate
  • leuser: Only list log entries made by this user
  • letitle: Only list log entries related to this title
  • lestart: The timestamp to start listing from
  • leend: The timestamp to end listing at
  • ledir: Direction to list in
    • older: List newest log entries first (default). Note: lestart has to be later than leend.
    • newer: List oldest log entries first. Note: lestart has to be before leend.
  • lelimit: Maximum number of log entries to list (10 by default)
  • leprefix: Filter entries that start with this prefix. Disabled in Miser Mode
  • letag: Only list event entries tagged with this tag

Example[edit | edit source]

List the 3 most recent page moves

Error Codes[edit | edit source]

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

Notes[edit | edit source]

For autoblock unblock entries, the page title is shown as "User:$blockid". This is indeed not a User page, just the way it is stored. As per bug 17781

See also[edit | edit source]

Protectedtitles[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.15

Get a list of titles protected from creation.

Parameters[edit | edit source]

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

Example[edit | edit source]

Get the first 2 titles only sysops can create

Error Codes[edit | edit source]

None

Querypage[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.18

Get a list provided by a QueryPage-based special page.

Parameters[edit | edit source]

  • qppage: The name of the special page. Note, this is case sensitive. Possible values are:
    Ancientpages, BrokenRedirects, Deadendpages, Disambiguations, DoubleRedirects, Listredirects, Lonelypages, Longpages, Mostcategories, Mostimages, Mostlinkedcategories, Mostlinkedtemplates, Mostlinked, Mostrevisions, Fewestrevisions, Shortpages, Uncategorizedcategories, Uncategorizedpages, Uncategorizedimages, Uncategorizedtemplates, Unusedcategories, Unusedimages, Wantedcategories, Wantedfiles, Wantedpages, Wantedtemplates, Unwatchedpages, Unusedtemplates, Withoutinterwiki
  • qpoffset: When more results are available, use this to continue.
  • qplimit: Number of results to return.

Example[edit | edit source]

Show a list of first 10 pages which are uncategorized.

Random[edit | edit source]

random / rn[edit | edit source]

MediaWiki version: 1.12

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

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

Example

Get 5 random pages

Possible errors

None

Recentchanges[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.10

Get all recent changes to the wiki, à la Special:Recentchanges. This module can be used as a generator (but note that, like all other generators, it generates information about pages, not about revisions). Apparently, although many log actions can be viewed using this module, patrol actions are not among them. This module is implemented by ApiQueryRecentChanges.php.

Parameters[edit | edit source]

  • rcstart: The timestamp to start listing from (May not be more than $wgRCMaxAge into the past, which on Wikimedia wikis is 30 days[1])
  • rcend: The timestamp to end listing at
  • rcdir: Direction to list in
    • older: List newest changes first (default). Note: rcstart has to be later than rcend.
    • newer: List oldest changes first. Note: rcstart has to be before rcend.
  • rcnamespace: Only list changes in these namespaces
  • rcuser: Only list changes made by this user
  • rcexcludeuser: Do not list changes made by this user
  • rctag: Only list changes tagged with this tag
  • rctype: Only list certain types of changes
    • edit: Regular page edits
    • external: External edits
    • new: Page creations (Uploads are not listed as new but as log)
    • log: Log entries
  • rcshow: Only list items that meet these criteria. Conflicting options (such as minor and !minor) cannot be used together
    • minor: Only list minor edits
    • !minor: Don't list minor edits
    • bot: Only list bot edits
    • !bot: Don't list bot edits
    • anon: Only list edits by anonymous users
    • !anon: Only list edits by registered users
    • redirect: Only list edits to pages that are currently redirects
    • !redirect: Only list edits to pages that currently aren't redirects
    • patrolled: Only list edits flagged as patrolled. Only available to users with the patrol right
    • !patrolled: Only list edits not flagged as patrolled. Only available to users with the patrol right
  • rcprop: Which properties to get
    • user: The user who made the change. Also returns anon="" if it was an anonymous edit.
    • userid: The user id who made the change.
    • comment: The edit/log comment
    • parsedcomment: The parsed comment for the edit/log comment
    • timestamp: The time and date of the change (default)
    • title: The title the change was made to (default)
    • ids: Gets the following IDs: pageid (rc_cur_id); rcid (rc_this_oldid); old_revid (rc_last_oldid); and rcid (rc_id) (used for patrolling). (default)
    • sha1: content checksum for entries associated with a revision
    • sizes: The page size before (oldlen) and after (newlen) the change
    • redirect: Whether the changed page is currently a redirect
    • patrolled: Whether the change is patrolled. Only available to users with the patrol right
    • loginfo: If the change was a log event, add the logid, logtype and logaction fields and the log parameters (since >=1.13.0)
    • tags: List tags for the entry
    • flags:
      • new: A new page was created
      • minor: The change was a minor edit
      • bot: The change was a bot edit
  • rctoken: Which tokens to obtain for each change
  • rclimit: Maximum amount of changes to list (10 by default)
  • rctoponly: Only list changes which are the latest revision
  • rccontinue: When more results are available, use this to continue

Example[edit | edit source]

Get the 3 most recent changes with sizes and flags

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

Error Codes[edit | edit source]

  • 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

Output[edit | edit source]

The "type" that is returned can be 'edit', 'new', 'move', 'log', 'external', or 'move over redirect'.

See also[edit | edit source]

References[edit | edit source]

  1. https://github.com/wikimedia/operations-mediawiki-config/blob/30e0912531200293145ff4bb1fb044a8d9a4cb6d/wmf-config/CommonSettings.php#L327

Search[edit | edit source]

MediaWiki version: 1.11
Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e

Parameters[edit | edit source]

  • info – What metadata to return.
Type: one of totalhits, suggestion
  • limit – How many total pages to return. Type: limit
  • namespace – The namespace(s) to enumerate. Type: namespace
  • offset – Use this value to continue paging (return by query). Type: integer
  • prop – What properties to return:
size - Adds the size of the page in bytes
wordcount - Adds the word count of the page
timestamp - Adds the timestamp of when the page was last edited
score - Adds the score (if any) from the search engine
snippet - Adds a parsed snippet of the page
titlesnippet - Adds a parsed snippet of the page title
redirectsnippet - Adds a parsed snippet of the redirect
redirecttitle - Adds a parsed snippet of the redirect title
sectionsnippet - Adds a parsed snippet of the matching section
sectiontitle - Adds a parsed snippet of the matching section title
hasrelated - Indicates whether a related search is available
Type: one of size, wordcount, timestamp, score, snippet, titlesnippet, redirecttitle, redirectsnippet, sectiontitle, sectionsnippet, hasrelated
  • redirects – Include redirect pages in the search. Type: bool
  • search (required) – Search for all page titles (or content) that has this value. Type: string
  • what – Search inside the text or titles:
title - Search in page titles (default) (if search engine doesn't support title searches, such as Lucene which is used by Wikipedia, then srwhat=title falls back to text)
text - Search in page text
nearmatch - Search for the exact title
Depending on which search backend is in use, how srsearch is interpreted may vary. On Wikimedia wiki's which use Lucene search, see w:Help:Searching#Search_engine_features for information about the search syntax.

Error Codes[edit | edit source]

  • invalidtitle – Bad title ``key''.
  • invalidtitle – Bad title ``title''.
  • nosearch – The search parameter must be set.
    This was param-search before 1.17
  • readapidenied – You need read permission to use this module.
  • search-text-disabled – text search is disabled.
  • search-title-disabled – title search is disabled.

Example[edit | edit source]

Show a list of 10 pages that contain the word 'wikipedia'

See also[edit | edit source]

Tags[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
  • Prefix: tg
  • Required Rights: None
  • POST Only? No

List valid change tags.

Parameters[edit | edit source]

  • continue – When more results are available, use this to continue.
  • limit – The maximum number of tags to list. Type: limit
  • prop – Which properties to get name - Adds name of tag displayname - Adds system message for the tag description - Adds description of the tag hitcount - Adds the amount of revisions that have this tag.
Type: one of name, displayname, description, hitcount

Errors Codes[edit | edit source]

  • invalidtitle – Bad title ``key''.
  • invalidtitle – Bad title ``title''.
  • readapidenied – You need read permission to use this module.

Usercontribs[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.10

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

Parameters[edit | edit source]

  • ucuser: Users to retrieve contributions for
  • ucuserprefix: List contributions of all users whose name starts with this string. Overrides ucuser
    • 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
  • ucstart: The timestamp to start listing from (see API:Data formats#Timestamps)
  • ucend: The timestamp to end listing at (see API:Data formats#Timestamps)
  • uccontinue: When more results are available, use this to continue
  • ucdir: Direction to list in
    • older: List newest contributions first (default). Note: ucstart has to be later than ucend.
      • If using ucuserprefix, users will be listed in descending order (Z to A)
    • newer: List oldest contributions first. Note: ucstart has to be before ucend.
      • If using ucuserprefix, users will be listed in ascending order (A to Z)
  • uclimit: Maximum amount of contributions to list (10 by default)
  • ucnamespace: Only list contributions in these namespaces (numeric value)
  • ucshow: Only list contributions that meet these criteria. Conflicting options (such as minor and !minor) cannot be used together
    • minor: Only list minor edits
    • !minor: Don't list minor edits
    • patrolled: Only list patrolled edits. Only available to users with the patrol right
    • !patrolled: Only list non-patrolled edits. Only available to users with the patrol right
    • top: Only list top (latest) edits. (since MediaWiki 1.23)
    • !top: Only list non-top edits. (since MediaWiki 1.23)
    • new: Only list page creations. (since MediaWiki 1.23)
    • !new: Don't list page creations. (since MW 1.23)
      • If patrolled or !patrolled is used, revisions older than $wgRCMaxAge will not be shown.
  • ucprop: Which properties to get
    • ids: Page ID and revision ID. Starting in MediaWiki 1.22 this will also include the parent revision's id.
    • title: Title of the page that was changed
    • timestamp: Time and date of the contribution
    • comment: Edit/log comment
    • parsedcomment: Parsed edit/log comment
    • size: Size of the edit
    • sizediff: Size delta between the edit and its parent
    • patrolled: Whether the change is patrolled. Only available to users with the patrol right
    • flags:
      • new: A new page was created
      • minor: The change was a minor edit
      • bot: The change was a bot edit
      • top: This is the latest version of the article
    • tags: List of tags for the edit
  • uctoponly: Only show top edits (deprecated in favor of ucshow=top in MediaWiki 1.23)

Example[edit | edit source]

Get the first three contributions by en:User:Catrope

Error Codes[edit | edit source]

  • 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

See also[edit | edit source]

Users[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e


MediaWiki version: 1.12

Get information about a list of users. This module cannot be used as a generator. This module is implemented by ApiQueryUsers.php.

Parameters[edit | edit source]

Example[edit | edit source]

Getting information about a list of users

Error Codes[edit | edit source]

None

Watchlist[edit | edit source]

watchlist / wl[edit | edit source]

MediaWiki version: 1.10

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

  • wlstart: The timestamp to start listing from
  • wlend: The timestamp to end listing at
  • wldir: Direction to list in
    • older: List most recently changed pages first (default). Note: wlstart has to be later than wlend.
    • newer: List least recently changed pages first. Note: wlstart has to be before wlend.
  • wllimit: Maximum amount of pages to list (10 by default)
  • wlnamespace: Only list pages in these namespaces
  • wluser: Only list changes made by this user
  • wlexcludeuser: Do not list changes made by this user
  • wlowner: The user whose watchlist you want (must be accompanied by wltoken if it's not the currently logged-in user). Remember that using format=json with callback is always in a logged-out environment, meaning wltoken is required even if it's for the supposedly current logged-in user) (New in 1.17. Added in r66539)
  • wltoken: Security token that the wlowner has set in their preferences. (Note: New in 1.17. Added in r66539)
  • wlallrev: Include multiple revisions to the same page. This parameter cannot be used in generator mode
  • wltype: Only list certain types of changes (available from MW1.22wmf4)
    • edit: Regular page edits
    • external: External edits
    • new: Page creations
    • log: Log entries
  • wlshow: Only list revisions that meet these criteria. Conflicting options (such as minor and !minor) cannot be used together
    • minor: Only list minor edits
    • !minor: Don't list minor edits
    • bot: Only list bot edits
    • !bot: Don't list bot edits
    • anon: Only list edits by anonymous users
    • !anon: Only list edits by registered users
  • wlprop: Which properties to get
    • user: The user who made the change
    • comment: The edit/log comment
    • parsedcomment: The edit/log comment in HTML format with wikilinks and section references expanded into hyperlinks (New in 1.16. Added in r61761)
    • timestamp: The time and date of the change
    • notificationtimestamp: Adds timestamp of when the user was last notified about the edit
    • title: The title the change was made to (default)
    • ids: The page ID and revision ID (default)
    • sizes: The page size before and after the change
    • patrol: Whether the change is patrolled. Only available to users with the patrol right
    • flags: (default)
      • new: A new page was created
      • minor: The change was a minor edit
      • bot: The change was a bot edit
      • anon: The change was made by a user who wasn't logged in

Example

Get the current user's watchlist

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


Watchlistraw[edit | edit source]

Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語 • polski • українська
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.14

Returns a list of all pages on the logged in users watchlist.

Parameters[edit | edit source]

  • wrcontinue: Used to continue a previous request
  • wrnamespace: Only list pages in the given namespace(s)
  • wrlimit: How many total results to return per request
  • wrprop: Which additional properties to get (non-generator mode only):
    • changed: Adds timestamp of when the user was last notified about the edit
  • wrshow: Only list items that meet these criteria:
    • changed
    • !changed
  • wrowner: The name of the user whose watchlist you'd like to access
  • wrtoken: Give a security token (settable in preferences) to allow access to another user's watchlist

Example[edit | edit source]

List the first 3 pages on the watchlist from the category namespace

Note: This query module return its result direct under api, not under query like other query modules.

Errors Codes[edit | edit source]

  • bad_wlowner – Specified user does not exist.
  • bad_wltoken – Incorrect watchlist token provided -- please set a correct token in Special:Preferences.
  • invalidtitle – Bad title ``title''.
  • invalidtitle – Bad title ``key''.
  • notloggedin – You must be logged-in to have a watchlist.
  • readapidenied – You need read permission to use this module.
  • show – Incorrect parameter - mutually exclusive values may not be supplied.