API:Usercontribs

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

Quick overview:


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.

[edit] Parameters

  • ucuser: User 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 (use Combined date and time in UTC, e.g. 2011-08-24T11:53Z)
  • ucend: The timestamp to end listing at (use Combined date and time in UTC, e.g. 2011-08-24T11:59Z)
  • 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
      • 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
    • title: Title of the page that was changed
    • timestamp: Time and date of the contribution
    • comment: Edit/log comment
    • 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

[edit] Example

Get the first three contributions by en:User:Catrope

<?xml version="1.0" encoding="utf-8"?>
<api>
  <query-continue>
    <usercontribs ucstart="2007-06-11T09:23:57Z" />
  </query-continue>
  <query>
    <usercontribs>
      <item
        user="Catrope" pageid="11650099" revid="136629050"
        ns="3" title="User talk:Catrope" timestamp="2007-06-07T16:45:30Z"
        minor="" comment="Creation; directing to BW"
      />
      <item
        user="Catrope" pageid="11650100" revid="136629120"
        ns="2" title="User:Catrope" timestamp="2007-06-07T16:45:49Z"
        new="" minor="" comment="Creation; directing to BW"
      />
      <item
        user="Catrope" pageid="3383874" revid="136629407"
        ns="3" title="User talk:Ruud Koot" timestamp="2007-06-07T16:47:09Z"
        comment="Nested collapsible tables fix"
      />
    </usercontribs>
  </query>
</api>

[edit] Error Codes

  • 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
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox