XTools/API
Interactive OpenAPI docs are at xtools.wmcloud.org/api. These on-wiki docs are meant to supplement it. |
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.
Endpoints
Change log
3.22.0
Page API
/api/page/pageinfoendpoint- The
last_edit_idproperty has been removed. Use themodified_rev_idproperty instead. - The
authorandauthor_editcountproperties have been removed. Use thecreatorandcreator_editcountproperties instead. - The
ip_editsproperty has been removed. Use theanon_editsproperty instead.
- The
3.20.0 (2024-08-15)
Common to all APIs
- All
timestampproperties are now returned as ISO 8601 in the form of YYYY-MM-DDTHH:MM:SSZ. page_titleandfull_page_titlealways return values with underscores replaced with spaces.minorandrevertedproperties are always boolean instead of 0 or 1.
Page API
- The
/api/page/articleinfoendpoint has been renamed to/api/page/pageinfo.- The
watchersproperty returnsnullinstead of zero if the number of watchers is unknown. - The
authorandauthor_editcountproperties have been renamed tocreatorandcreator_editcount, respectively. - The
last_edit_idproperty has been renamed tomodified_rev_id. - The
created_atandmodified_atproperties are returned as ISO 8601 in the form of YYYY-MM-DDTHH:MM:SSZ.
- The
User API
- The
/api/user/category_editcountendpoint propertycategoriesis always returned as an array, even if there's only one element. - The
/api/user/month_countsendpoint gives thetotalsas an array keyed by namespace and then year/month in the format YYYY-MM, with the count as the values.
3.18.0 (2023-07-10)
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_namespaceproperties are now namednamespace. - All
page_is_redirectproperties are now namedredirect, and this returns a boolean, not an integer. - All
rev_timestampproperties are now namedtimestamp.
Project API
- The
/api/users_groupsand/api/admins_groupsendpoints have been removed. Use/api/admin_groups,/api/patroller_groupsand/api/steward_groupsinstead. - The
/api/project/automated_toolsendpoint results are now nested under thetoolsproperty.
Page API
- The
/api/articleinfoendpoint is removed. Use/api/page/articleinfoinstead. - The
/api/page/assessmentsendpoint results are now nested under thepagesproperty.
User API
- The
/api/user/automated_toolsendpoint has been removed. Use/api/project/automated_toolsinstead. - The
/api/user/pages_countendpoint now always groups results by namespace, even if a specific namespace was provided. Before, it only grouped by namespace ifallwas provided as the value for thenamespaceparameter. - The
/api/user/pagesendpoint- Now always groups results by namespace, even if a specific namespace was provided. Before, it only grouped by namespace if
allwas provided as the value for thenamespaceparameter. - 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, andassessment(with keysclass,badge,colorandcategory). pa_importanceproperty is no longer included, as this represents the importance level of only a single WikiProjects and not the page overall.human_timeandraw_timeproperties are removed. Usetimestampinstead and do your own formatting as desired.badge_fileproperty has been removed.
- Now always groups results by namespace, even if a specific namespace was provided. Before, it only grouped by namespace if
- The
/api/user/top_editsendpoint- Now returns the
full_page_titleproperty instead ofpage_title_ns. - The
pa_classproperty is replaced byassessment, which has the keysclass,badge,colorandcategory. - The
rev_deletedproperty has been removed. - The
revertedproperty is now a boolean instead of an integer. - The
minorproperty is now a boolean instead of an integer.
- Now returns the
Errors
- All fatal errors (not warnings) are in the format specified by RFC 7807, with at minimum
status,titleanddetailsproperties. Warnings are still be an array under thewarningproperty.