API:Usercontribs

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki API documentation.
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.9

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]