API:Usercontribs
| Other languages: | English • polski • 中文 |
|---|
| This page is part of the MediaWiki Action API documentation. |
| Please help improve this technical documentation! Take our MediaWiki Action API Technical Documentation User Feedback Survey before 6 January – Note: The survey uses Google Forms. See Privacy Statement – Thanks! |
| Usercontribs | ||
|---|---|---|
This module cannot be used as a Generator. |
||
| Prefix | uc | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
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.
Contents
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 seeucdirbelow for more information.ucend: The timestamp to end listing at (see API:Data formats#Timestamps). Also seeucdirbelow for more information.uccontinue: When more results are available, use this to continue. 1.14+ucuser: Users to retrieve contributions for. Cannot be used withucuseridorucuserprefix.ucuserids: The user IDs to retrieve contributions for. Cannot be used withucuserorucuserprefix. 1.29+ucuserprefix: List contributions of all users whose name starts with this string. Cannot be used withucuserorucuserids. 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:ucstarthas to be earlier thanucend.older: List newest contributions first. If there are multiple users, they will be listed in descending order (Z to A). Note:ucstarthas to be later thanucend
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 changedtimestamp: Time and date of the contributioncomment: Edit/log commentparsedcomment: 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 thebotflag is not included, it is only available through API:Recentchanges):new: A new page was createdminor: The change was a minor edittop: This is the latest version of the article
patrolled: Whether the change is patrolled. Only available to users with thepatrolright 1.15+tags: List of tags for the edit 1.16+
ucshow: Only list contributions that meet these criteria. Conflicting options (such asminorand!minor) cannot be used together. Note: Ifpatrolledor!patrolledare used, revisions older than $wgRCMaxAge will not be shown. 1.11+minor: Only list minor edits!minor: Don't list minor editspatrolled: Only list patrolled edits. Only available to users with thepatrolright 1.15+!patrolled: Only list non-patrolled edits. Only available to users with thepatrolright 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
| Result |
|---|
<?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>
|
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]
- API:Logevents (to get the user's uploads for example)
| The following documentation is the output of Special:ApiHelp/query+usercontribs, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
list=usercontribs (uc)
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0-or-later
Get all edits by a user.
- 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, 5500, 5501
- 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, autopatrolled, !autopatrolled, 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)
- 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]