API:Usercontribs

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

Quick overview:

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

  • 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). Note: ucstart has to be later than ucend.
  • ucend: The timestamp to end listing at (see API:Data formats#Timestamps) Note: ucstart has to be earlier than ucend.
  • uccontinue: When more results are available, use this to continue. 1.14+
  • 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. 1.13+
  • ucdir: Direction to list in. (Default: older)
    • older: List newest contributions first. If there are multiple users, they will be listed in descending order (Z to A).
    • newer: List oldest contributions first. If there are multiple users, they will be listed in ascending order (A to Z).
  • 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 | edit source]

Get the first three contributions by en:User:Catrope

Error Codes[edit | edit source]

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