API:Usercontribs

From MediaWiki.org
Jump to: navigation, search
Language:Project:Language policy English  • polski • 中文
Tools clipart.png This page is part of the MediaWiki action API documentation.
MediaWiki APIsAPI:Main page

MediaWiki action API

v · d · e

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

Version notes: Prior to MW 1.14, the start parameter was used to continue. Between 1.14 and 1.22, start was used as a continue for single-user mode; continue was used as a continue for multi-user mode. From 1.23 forwards, continue is the only continue parameter.

Parameters[edit]

  • uclimit: Maximum amount of contributions to list No more than 500 (5000 for bots) allowed. (Default: 10)
  • ucstart: The timestamp to start listing from (see API:Data formats#Timestamps). Also see ucdir below for more information.
  • ucend: The timestamp to end listing at (see API:Data formats#Timestamps). Also see ucdir below for more information.
  • uccontinue: When more results are available, use this to continue. 1.14+
  • ucuser: Users to retrieve contributions for. Cannot be used with ucuserid or ucuserprefix.
  • ucuserids: The user IDs to retrieve contributions for. Cannot be used with ucuser or ucuserprefix. 1.29+
  • ucuserprefix: List contributions of all users whose name starts with this string. Cannot be used with ucuser or ucuserids. 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. 1.13+
  • ucdir: Direction to list in. (Default: older)
    • newer: List oldest contributions first. If there are multiple users, they will be listed in ascending order (A to Z). Note: ucstart has to be earlier than ucend.
    • older: List newest contributions first. If there are multiple users, they will be listed in descending order (Z to A). Note: ucstart has to be later than ucend
  • ucnamespace: Only list contributions in these namespaces (pipe-separated numeric values). 1.11+
  • ucprop: Which properties to get. (Default: ids|title|timestamp|comment|size|flags) 1.11+
    • 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 1.16+
    • size: Size of the edit 1.16+
    • sizediff: Size delta between the edit and its parent 1.20+
    • flags: Flags that apply to the edit (note that the bot flag is not included, it is only available through API:Recentchanges):
      • new: A new page was created
      • minor: The change was a minor edit
      • top: This is the latest version of the article
    • patrolled: Whether the change is patrolled. Only available to users with the patrol right 1.15+
    • tags: List of tags for the edit 1.16+
  • ucshow: Only list contributions that meet these criteria. Conflicting options (such as minor and !minor) cannot be used together. Note: If patrolled or !patrolled are used, revisions older than $wgRCMaxAge will not be shown. 1.11+
    • minor: Only list minor edits
    • !minor: Don't list minor edits
    • patrolled: Only list patrolled edits. Only available to users with the patrol right 1.15+
    • !patrolled: Only list non-patrolled edits. Only available to users with the patrol right 1.15+
    • top: Only list top (latest) edits. 1.23+
    • !top: Only list non-top edits. 1.23+
    • new: Only list page creations. 1.23+
    • !new: Don't list page creations. 1.23+
  • uctag: Only list revisions tagged with this tag 1.16+
  • uctoponly: Only show top edits (deprecated in favor of ucshow=top) 1.18+ (Deprecated in 1.23)

Example[edit]

Get the first three contributions by en:User:Catrope

Error Codes[edit]

Code Info
ucparam_user User name username is not valid
ucparam_user User parameter may not be empty
ucshow Incorrect parameter - mutually exclusive values may not be supplied
permissiondenied You need the patrol right to request the patrolled flag

See also[edit]




list=usercontribs (uc)

(main | query | usercontribs)
  • This module requires read rights.
  • Source: MediaWiki
  • License: GPL-2.0+

Get all edits by a user.

Parameters:
uclimit

The maximum number of contributions to return.

No more than 500 (5,000 for bots) allowed.
Type: integer or max
Default: 10
ucstart

The start timestamp to return from.

Type: timestamp (allowed formats)
ucend

The end timestamp to return to.

Type: timestamp (allowed formats)
uccontinue

When more results are available, use this to continue.

ucuser

The users to retrieve contributions for. Cannot be used with ucuserids or ucuserprefix.

Type: list of user names
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
ucuserids

The user IDs to retrieve contributions for. Cannot be used with ucuser or ucuserprefix.

Type: list of integers
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
ucuserprefix

Retrieve contributions for all users whose names begin with this value. Cannot be used with ucuser or ucuserids.

ucdir

In which direction to enumerate:

newer
List oldest first. Note: ucstart has to be before ucend.
older
List newest first (default). Note: ucstart has to be later than ucend.
One of the following values: newer, older
Default: older
ucnamespace

Only list contributions in these namespaces.

Values (separate with | or alternative): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 486, 487, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600
To specify all values, use *.
ucprop

Include additional pieces of information:

ids
Adds the page ID and revision ID.
title
Adds the title and namespace ID of the page.
timestamp
Adds the timestamp of the edit.
comment
Adds the comment of the edit.
parsedcomment
Adds the parsed comment of the edit.
size
Adds the new size of the edit.
sizediff
Adds the size delta of the edit against its parent.
flags
Adds flags of the edit.
patrolled
Tags patrolled edits.
tags
Lists tags for the edit.
Values (separate with | or alternative): ids, title, timestamp, comment, parsedcomment, size, sizediff, flags, patrolled, tags
Default: ids|title|timestamp|comment|size|flags
ucshow

Show only items that meet these criteria, e.g. non minor edits only: ucshow=!minor.

If ucshow=patrolled or ucshow=!patrolled is set, revisions older than $wgRCMaxAge (2592000 seconds) won't be shown.

Values (separate with | or alternative): minor, !minor, patrolled, !patrolled, top, !top, new, !new
uctag

Only list revisions tagged with this tag.

uctoponly
Deprecated.

Only list changes which are the latest revision.

Type: boolean (details)
Examples:
Show contributions of user Example.
api.php?action=query&list=usercontribs&ucuser=Example [open in sandbox]
Show contributions from all IP addresses with prefix 192.0.2..
api.php?action=query&list=usercontribs&ucuserprefix=192.0.2. [open in sandbox]