API:Recentchanges

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:

v · d · e


MediaWiki version: 1.10

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). Apparently, although many log actions can be viewed using this module, patrol actions are not among them. This module is implemented by ApiQueryRecentChanges.php.

Parameters[edit | edit source]

  • 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
  • rcdir: Direction to list in
    • older: List newest changes first (default). Note: rcstart has to be later than rcend.
    • newer: List oldest changes first. Note: rcstart has to be before rcend.
  • 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
  • rcshow: Only list items 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
    • 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
    • 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 (default)
    • title: The title the change was made to (default)
    • ids: Gets the following IDs: pageid (rc_cur_id); rcid (rc_this_oldid); old_revid (rc_last_oldid); and rcid (rc_id) (used for patrolling). (default)
    • 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
    • patrolled: Whether the change is patrolled. Only available to users with the patrol right
    • loginfo: If the change was a log event, add the logid, logtype and logaction fields and the log parameters (since >=1.13.0)
    • 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
  • rclimit: Maximum amount of changes to list (10 by default)
  • rctoponly: Only list changes which are the latest revision
  • rccontinue: When more results are available, use this to continue

Example[edit | edit source]

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

  • code: rcshow
    • info: Incorrect parameter - mutually exclusive values may not be supplied
  • code: rcpermissiondenied
    • info: You need the patrol right to request the patrolled flag

Output[edit | edit source]

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

See also[edit | edit source]

References[edit | edit source]

  1. https://github.com/wikimedia/operations-mediawiki-config/blob/30e0912531200293145ff4bb1fb044a8d9a4cb6d/wmf-config/CommonSettings.php#L327