From MediaWiki.org
(Redirected from API:Recentchanges)
Jump to navigation Jump to search

Get all recent changes to the wiki, in the same manner as Special:RecentChanges lists them. 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).


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 than rcend.
    • newer: List oldest changes first. Note: rcstart has to be earlier than rcend.
  • 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 at
  • rcnamespace: Only list changes in these namespaces
  • rcuser: Only list changes made by this user
  • rcexcludeuser: Do not list changes made by this user
  • rctag: Only list changes tagged with this tag
  • rctype: Only list certain types of changes
    • edit: Regular page edits
    • external: External edits
    • new: Page creations (Uploads are not listed as new but as log)
    • log: Log entries
    • categorize: Page categorizations
  • rcshow: Only list items that meet all of these criteria. Conflicting options (such as minor and !minor) cannot be used together
    • minor: Only list minor edits
    • !minor: Don't list minor edits
    • bot: Only list bot edits
    • !bot: Don't list bot edits
    • anon: Only list edits by anonymous users
    • !anon: Only list edits by registered users
    • redirect: Only list edits to pages that are currently redirects
    • !redirect: Only list edits to pages that currently aren't redirects
    • patrolled: Only list edits flagged as patrolled. Only available to users with the patrol right
    • !patrolled: Only list edits not flagged as patrolled. Only available to users with the patrol 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 comment
    • parsedcomment: The parsed comment for the edit/log comment
    • timestamp: The time and date of the change
    • title: The title the change was made to
    • ids: Gets the following IDs: pageid (rc_cur_id); revid (rc_this_oldid); old_revid (rc_last_oldid); and rcid (rc_id) (used for patrolling).
    • sha1: content checksum for entries associated with a revision
    • sizes: The page size before (oldlen) and after (newlen) the change
    • redirect: 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 the patrol right. When returned, the value is an empty string.
    • loginfo: If the change was a log event, add the logid, logtype and logaction fields and the log parameters 1.13+
    • tags: List tags for the entry
    • flags
      • new: A new page was created
      • minor: The change was a minor edit
      • bot: The change was a bot edit
  • rctoken: Which tokens to obtain for each change (deprecated in 1.24)
  • rclimit: Maximum amount of changes to list (Default: 10)
  • rctoponly: Only list changes which are the latest revision
  • rccontinue: When more results are available, use this to continue
  • rctitles: Restrict results to these page titles 1.14-1.15 (removed in 1.15)


Get the 3 most recent changes with sizes and flags

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

Code Info
rcshow Incorrect parameter - mutually exclusive values may not be supplied
rcpermissiondenied You need the patrol right to request the patrolled flag


The "type" that is returned can be 'edit', 'new', 'move', 'categorize', 'log', 'external', or 'move over redirect'.

See also[edit]