XTools/API/Project
The XTools Project API endpoints offer data related to a specific project.
Interactive OpenAPI docs are at xtools.wmcloud.org/api. These on-wiki docs are meant to supplement it. |
Normalize project
/api/project/normalize/{project}
Get the URL, database name, domain and API path of a given project.
Parameters
project
(required) – Project domain or database name.
Examples
Get basic access information about the English Wikipedia:
- https://xtools.wmflabs.org/api/project/normalize/enwiki
- https://xtools.wmflabs.org/api/project/normalize/en.wikipedia
- https://xtools.wmflabs.org/api/project/normalize/en.wikipedia.org
Namespaces
/api/project/namespaces/{project}
Get the localized names for each namespace of the given project. The API endpoint for the project is also returned.
Parameters
project
(required) – Project domain or database name.
Examples
Get the namespace IDs and names of the German Wikipedia:
- https://xtools.wmflabs.org/api/project/namespaces/dewiki
- https://xtools.wmflabs.org/api/project/namespaces/de.wikipedia
- https://xtools.wmflabs.org/api/project/namespaces/de.wikipedia.org
Page assessments
/api/project/assessments/{project}
Get page assessment metadata for the given project. This includes all the different quality classifications and importance levels, along with their associated colours and badges.
Parameters
project
(required) – Project domain or database name.
Examples
- https://xtools.wmflabs.org/api/project/assessments/enwiki
- https://xtools.wmflabs.org/api/project/assessments/en.wikipedia
- https://xtools.wmflabs.org/api/project/assessments/en.wikipedia.org
Page assessments configuration
/api/project/assessments
Get a list of wikis that support page assessments, and the configuration for each. This includes all the different quality classifications and importance levels, along with their associated colours and badges.
Examples
Get the XTools Page Assessments configuration:
- https://xtools.wmflabs.org/api/project/assessments
Automated tools
/api/project/automated_tools/{project}
Get a list of the known (semi-)automated tools used on the given project.
Response format
For each tool, the some or all of the following data is provided:
tags
: Tags that identify edits made using the tool.regex
: Regular expression that can be used against edit summaries to test if the tool was used.link
: Path to the tool's documentation.label
: Translation of the tool's name, if applicable and available.revert
: Whether or not the tool is exclusively used for reverting edits.namespaces
: Which namespaces the tool is used in.talk_namespaces
: Used instead ofnamespaces
to indicate the tool is used on all talk namespaces.contribs
: If true, edits made by the tool should be interpreted as authored by the user, and not entirely automated. In the case of XTools, this means the edits will appear in the user's list of non-automated edits.
Parameters
project
(required) – Project domain or database name.
Examples
Get all the known semi-automated tools used on the English Wikipedia.
- https://xtools.wmflabs.org/api/project/automated_tools/en.wikipedia.org
Admins and user groups
/api/project/admins_groups/{project}
Get a list of users who are capable of making admin-like actions, and the relevant user groups they are in.
Parameters
project
(required) – Project domain or database name.
Examples
Get administrative users of the French Wikipedia:
- https://xtools.wmflabs.org/api/project/admins_groups/frwiki
- https://xtools.wmflabs.org/api/project/admins_groups/fr.wikipedia.org
Admin statistics
/api/project/admin_stats/{project}/{start}/{end}
Get users of the project that are capable of making ‘admin actions’, along with counts of the actions they took. Time period is limited to 31 days.
Parameters
project
(required) – Project domain or database name.start
– Start date in the formatYYYY-MM-DD
. Defaults to 31 days beforeend
.end
– End date in the formatYYYY-MM-DD
. Defaults to current day (UTC).
The date range defaults to the past 31 days, and is limited to a 31-day period. If you need a wider range of data, you must make the the individual requests (synchronously), and do the math in your application.
Query string parameters
Optional query string parameters to further filter results.
actions
– A pipe-separated list of ‘actions’ you want to query for. Defaults to all available actions. Query only for the actions you care about to get faster results. Available actions include:delete
– Deleting pagesrevision-delete
– Deleting revisions from pageslog-delete
– Deleting revisions from pagesrestore
– Undeleting pagesre-block
– Blocking users and re-blocking with modified block settingsunblock
– Unblocking usersre-protect
– Protecting pages and re-protecting with modified protection settingsunprotect
– Removing protection from pagesrights
– Changing user groupsmerge
– Merging page historiesimport
– Importing revisions from another wikiabusefilter
– Management of AbuseFilters
If you are interested in exactly which permissions are used in the queries, please review the YAML configuration.
Examples
Get ‘re-block’ and ‘abusefilter’ statistics for every active admin on the French Wikipedia:
- https://xtools.wmflabs.org/api/project/admin_stats/fr.wikipedia?actions=re-block|abusefilter
Get statistics about all relevant actions taken by Spanish Wikipedia admins in January 2019:
- https://xtools.wmflabs.org/api/project/admin_stats/es.wikipedia/2019-01-01/2019-01-31
Patroller statistics
/api/project/patroller_stats/{project}/{start}/{end}
Get users of the project that are capable of making marking pages as patrolled or hold FlaggedRevs or PageTriage user rights (where applicable), along with counts of the actions they took. Time period is limited to one year (365 days).
Parameters
project
(required) – Project domain or database name.start
– Start date in the formatYYYY-MM-DD
. Defaults to 31 days beforeend
.end
– End date in the formatYYYY-MM-DD
. Defaults to current day (UTC).
The date range defaults to the past 31 days, and is limited to a 365-day period. If you need a wider range of data, you must make the the individual requests (synchronously), and do the math in your application.
Query string parameters
Optional query string parameters to further filter results.
actions
– A pipe-separated list of ‘actions’ you want to query for. Defaults to all available actions. Query only for the actions you care about to get faster results. Available actions include:patrol
– Marking edits or articles as patrolled.page-curation
– Page Curation actionspc-accept
– accepting FlaggedRevs (Pending Changes)pc-reject
– rejecting FlaggedRevs (Pending Changes)
If you are interested in exactly which permissions are used in the queries, please review the YAML configuration.
Examples
Get ‘patrol’ and ‘page-curation’ statistics for relevant users on the English Wikipedia over the 31 days:
- https://xtools.wmflabs.org/api/project/patroller_stats/en.wikipedia?actions=patrol|page-curation
Steward statistics
/api/project/steward_stats/{project}/{start}/{end}
Get users of the project with steward-like permissions. Time period is limited to one year (365 days).
Parameters
project
(required) – Project domain or database name.start
– Start date in the formatYYYY-MM-DD
. Defaults to 31 days beforeend
.end
– End date in the formatYYYY-MM-DD
. Defaults to current day (UTC).
The date range defaults to the past 31 days, and is limited to a 365-day period. If you need a wider range of data, you must make the the individual requests (synchronously), and do the math in your application.
Query string parameters
Optional query string parameters to further filter results.
actions
– A pipe-separated list of ‘actions’ you want to query for. Defaults to all available actions. Query only for the actions you care about to get faster results. Available actions include:global-account-un-lock
– Global account locks/unlocks; NOTE: Locks that involved hiding or suppressing usernames are hidden from public view and cannot be detected by XTools.global-block
– Global blocksglobal-unblock
– Global unblocksglobal-rename
– Global renamesglobal-rights
– Global user rights changeswiki-set-change
– Wiki set changes
If you are interested in exactly which permissions are used in the queries, please review the YAML configuration.
Examples
Get ‘global-block’ and ‘global-account-un-lock’ statistics for relevant users on the Meta over the 31 days:
- https://xtools.wmflabs.org/api/project/steward_stats/meta.wikimedia?actions=global-block|global-account-un-lock
Largest pages
/api/project/largest_pages/{project}/{namespace}
List the largest pages on a project.
Parameters
project
(required) – Project domain or database name.namespace
– Namespace ID orall
(default) for all namespaces.
Query string parameters
Optional query string parameters to further filter results.
inclusion_pattern
– Filter results to only include pages with titles matching the given pattern.exclusion_pattern
– Filter results to exclude pages with titles matching the given pattern.
The wildcard symbol is %
which must be encoded (%25).
Examples
Get the largest non-list articles on the English Wikipedia:
- https://xtools.wmflabs.org/api/project/largest_pages/en.wikipedia.org/0?include_pattern=&exclude_pattern=%25List%25