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.

Contents

[edit] Parameters

  • rcstart: The timestamp to start listing from
  • 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
    • new: Page creations
    • 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)
    • 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

[edit] Example

Get the 3 most recent changes with sizes and flags

<?xml version="1.0" encoding="utf-8"?>
<api>
  <query-continue>
    <recentchanges rcstart="2008-03-25T22:03:47Z" />
  </query-continue>
  <query>
    <recentchanges>
      <rc
        type="log"
        ns="-1"
        title="Special:Log/protect"
        rcid="205182563"
        pageid="0"
        revid="0"
        old_revid="0"
        user="Yamla"
        oldlen="0"
        newlen="0"
      />
      <rc
        type="new"
        ns="0"
        title="Clasico de Avellaneda"
        rcid="205182562"
        pageid="16578364"
        revid="200906507"
        old_revid="0"
        user="Eubot"
        bot=""
        new=""
        oldlen="0"
        newlen="66"
      />
      <rc
        type="edit"
        ns="3"
        title="User talk:Diligent Terrier"
        rcid="205182561"
        pageid="12353452"
        revid="200906506"
        old_revid="200863749"
        user="Basketball110"
        oldlen="202363"
        newlen="202761"
      />
    </recentchanges>
  </query>
</api>

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

[edit] Error Codes

  • 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

[edit] See also