XTools/API

From mediawiki.org
Please first review the MediaWiki API and REST APIs to see if they meet your needs. These will be considerably faster than XTools and allow for asynchronous requests.

The XTools features a rich API for much of the data available through the web interface. Out of courtesy we ask you make requests synchronously – as in one full round trip – before making a new request. Please leave an informative user agent in your request so we can contact you if we need to.

Errors and warnings

Error messages are in the format specified by RFC 7807, with at minimum status, title and details properties.

Please log any responses with a warning property as this will announce deprecations and future changes.

To ensure performance and stability, most endpoints related to users will return a 501 response code if the user has made an exceptionally high number of edits. In the future, requests for such users may be permitted but will require authentication.

OpenAPI Specification

Version 3.18.0 introduced the first OpenAPI Specification of the XTools API. For the sake of consistency, many of the endpoints now have new standardized responses, and a few endpoints have been renamed or removed. XTools 3.18.0 was released on July 10, 2023.

Here is a summary of the breaking changes:

Common to all APIs

  • All page_namespace properties are now named namespace.
  • All page_is_redirect properties are now named redirect, and this returns a boolean, not an integer.
  • All rev_timestamp properties are now named timestamp.

Project API

  • The /api/users_groups and /api/admins_groups endpoints have been removed. Use /api/admin_groups, /api/patroller_groups and /api/steward_groups instead.
  • The /api/project/automated_tools endpoint results are now nested under the tools property.

Page API

  • The /api/articleinfo endpoint is removed. Use /api/page/articleinfo instead.
  • The /api/page/assessments endpoint results are now nested under the pages property.

User API

  • The /api/user/automated_tools endpoint has been removed. Use /api/project/automated_tools instead.
  • The /api/user/pages_count endpoint now always groups results by namespace, even if a specific namespace was provided. Before, it only grouped by namespace if all was provided as the value for the namespace parameter.
  • The /api/user/pages endpoint
    • Now always groups results by namespace, even if a specific namespace was provided. Before, it only grouped by namespace if all was provided as the value for the namespace parameter.
    • Each page has the properties deleted (whether the page is deleted or not), namespace, page_title, full_page_title, redirect (boolean), timestamp, rev_id, rev_length, length (current length of the page), recreated, and assessment (with keys class, badge, color and category).
    • pa_importance property is no longer included, as this represents the importance level of only a single WikiProjects and not the page overall.
    • human_time and raw_time properties are removed. Use timestamp instead and do your own formatting as desired.
    • badge_file property has been removed.
  • The /api/user/top_edits endpoint
    • Now returns the full_page_title property instead of page_title_ns.
    • The pa_class property is replaced by assessment, which has the keys class, badge, color and category.
    • The rev_deleted property has been removed.
    • The reverted property is now a boolean instead of an integer.
    • The minor property is now a boolean instead of an integer.

Errors

  • All fatal errors (not warnings) are in the format specified by RFC 7807, with at minimum status, title and details properties. Warnings are still be an array under the warning property.

Endpoints