API:RecentChanges
This page is part of the MediaWiki Action API documentation. |
RecentChanges | ||
---|---|---|
This module can be used as a generator. | ||
Prefix | rc | |
Required rights | none | |
Post only? | No | |
Generated help | Current | |
Version added |
|
Get all recent changes to the wiki, à la Special:Recentchanges. This module can be used as a generator (but note that, like all other generators, it generates information about pages, not about revisions). This module is implemented by ApiQueryRecentChanges.php.
Note that, although many log actions can be viewed using this module, patrol actions are not among them (because they are not present in the recentchanges table).
Parameters
Please note that by default, the Recentchanges table is queried is in reverse-chronological order with the most recent changes at the start of the list. This means that any specified rcstart
value must be later than any specified rcend
value. This requirement is reversed if a rcdir=newer
is specified.
rcdir
: Direction to list in (Default:older
)older
: List newest changes first. Note:rcstart
has to be later thanrcend
.newer
: List oldest changes first. Note:rcstart
has to be earlier thanrcend
.
rcstart
: The timestamp to start listing from (May not be more than $wgRCMaxAge into the past, which on Wikimedia wikis is 30 days[1])rcend
: The timestamp to end listing atrcnamespace
: Only list changes in these namespacesrcuser
: Only list changes made by this userrcexcludeuser
: Do not list changes made by this userrctag
: Only list changes tagged with this tagrctype
: Only list certain types of changesedit
: Regular page editsexternal
: External editsnew
: Page creations (Uploads are not listed asnew
but aslog
)log
: Log entries
rcshow
: Only list items that meet these criteria. Conflicting options (such asminor
and!minor
) cannot be used togetherminor
: Only list minor edits!minor
: Don't list minor editsbot
: Only list bot edits!bot
: Don't list bot editsanon
: Only list edits by anonymous users!anon
: Only list edits by registered usersredirect
: Only list edits to pages that are currently redirects!redirect
: Only list edits to pages that currently aren't redirectspatrolled
: Only list edits flagged as patrolled. Only available to users with thepatrol
right!patrolled
: Only list edits not flagged as patrolled. Only available to users with thepatrol
right
rcprop
: Which properties to get (Default:timestamp|title|ids
)user
: The user who made the change. Also returns anon="" if it was an anonymous edit.userid
: The user id who made the change.comment
: The edit/log commentparsedcomment
: The parsed comment for the edit/log commenttimestamp
: The time and date of the changetitle
: The title the change was made toids
: Gets the following IDs:pageid
(rc_cur_id);revid
(rc_this_oldid);old_revid
(rc_last_oldid); andrcid
(rc_id) (used for patrolling).sha1
: content checksum for entries associated with a revisionsizes
: The page size before (oldlen
) and after (newlen
) the changeredirect
: Whether the changed page is currently a redirect. When returned, the value is an empty string; not the redirect destination.patrolled
: Whether the change is patrolled. Only available to users with thepatrol
right. When returned, the value is an empty string.loginfo
: If the change was a log event, add thelogid
,logtype
andlogaction
fields and the log parameters 1.13+tags
: List tags for the entryflags
rctoken
: Which tokens to obtain for each change (deprecated in 1.24)patrol
: The patrol token
rclimit
: Maximum amount of changes to list (Default: 10)rctoponly
: Only list changes which are the latest revisionrccontinue
: When more results are available, use this to continuerctitles
: Restrict results to these page titles 1.14-1.15 (removed in 1.15)
Example
Result |
---|
{
"batchcomplete": "",
"continue": {
"rccontinue": "20180330090522|1041353210",
"continue": "-||"
},
"query": {
"recentchanges": [
{
"type": "edit",
"ns": 0,
"title": "Histology",
"pageid": 13570,
"revid": 833218500,
"old_revid": 833218201,
"rcid": 1041353213,
"user": "Iztwoz",
"oldlen": 25718,
"newlen": 25749
},
{
"type": "edit",
"ns": 0,
"title": "Mario Zorzi",
"pageid": 45004653,
"revid": 833218498,
"old_revid": 724129407,
"rcid": 1041353212,
"user": "KolbertBot",
"bot": "",
"minor": "",
"oldlen": 1317,
"newlen": 1318
},
{
"type": "edit",
"ns": 4,
"title": "Wikipedia:Categories for discussion/Log/2018 March 29",
"pageid": 56683912,
"revid": 833218499,
"old_revid": 833205660,
"rcid": 1041353211,
"user": "Grutness",
"oldlen": 7799,
"newlen": 8008
}
]
}
}
|
Possible warnings
- Action 'action' is not allowed for the current user
- Thrown when a token is requested that the current user isn't allowed to use
Error Codes
Code | Info |
---|---|
rcshow | Incorrect parameter - mutually exclusive values may not be supplied |
rcpermissiondenied | You need the patrol right to request the patrolled flag |
Output
The "type" that is returned can be 'edit', 'new', 'move', 'categorize', 'log', 'external', or 'move over redirect'.