XTools/API/User
The XTools User API endpoints offer data related to a specific user.
Interactive OpenAPI docs are at xtools.wmcloud.org/api. These on-wiki docs are meant to supplement it. |
Simple edit count
/api/user/simple_editcount/{project}/{username}/{namespace}/{start}/{end}
For the given user, get the user ID, live and deleted edit count, local user groups and global user groups.
Response format
The Simple Edit Count endpoint will return limited data if the user has a very high edit count. In this case the namespace
, start
and end
parameters are ignored, and only the approximate system edit count is returned. Look for approximate
as one of the keys in the response body.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
(default) for all namespaces.start
– Start date in the formatYYYY-MM-DD
.end
– End date in the formatYYYY-MM-DD
.
Examples
Get basic statistics about Jimbo Wales on the English Wikipedia.
- https://xtools.wmflabs.org/api/user/simple_editcount/en.wikipedia/Jimbo_Wales
Get basic statistics about Jimbo Wales, but only during the year of 2014 and within the mainspace.
- https://xtools.wmflabs.org/api/user/simple_editcount/en.wikipedia/Jimbo_Wales/0/2014-01-01/2014-12-31
Number of pages created
/api/user/pages_count/{project}/{username}/{namespace}/{redirects}/{deleted}/{start}/{end}
Get the number of pages created by the user in the given namespace.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
(default) for all namespaces.redirects
– One of 'noredirects' (default), 'onlyredirects' or 'all' for both.deleted
– One of 'live', 'deleted' or 'all' (default).start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent data.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent data.
Examples
Get the number of mainspace, non-redirect pages created by Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/pages_count/en.wikipedia/Jimbo_Wales
Get the number of article talk pages created by Jimbo Wales that are redirects:
- https://xtools.wmflabs.org/api/user/pages_count/en.wikipedia/Jimbo_Wales/1/onlyredirects
Pages created
/api/user/pages/{project}/{username}/{namespace}/{redirects}/{deleted}/{start}/{end}/{offset}
Get the number of pages created by the user in the given namespace.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
(default) for all namespaces.redirects
– One of 'noredirects' (default), 'onlyredirects' or 'all' for both.deleted
– One of 'live', 'deleted' or 'all' (default).start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent data.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent data.offset
– Shows pages created before this timestamp. This is used for pagination. If there is more than one page of results,continue
is returned, with the offset timestamp as the value.
Examples
Get the mainspace, non-redirect pages created by Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/pages_count/en.wikipedia/Jimbo_Wales
Get the article talk pages created by Jimbo Wales that are redirects:
- https://xtools.wmflabs.org/api/user/pages/en.wikipedia/Jimbo_Wales/1/onlyredirects
Automated edit counter
/api/user/automated_editcount/{project}/{username}/{namespace}/{start}/{end}/{tools}
Get the number of (semi-)automated edits made by the given user in the given namespace and date range. You can optionally pass in ?tools=1
to get individual counts of each (semi-)automated tool that was used.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
for all namespaces. Defaults to the mainspace.start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent data.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent data.tools
– Set to any truthy value to include the tools that were used and their counts.
Examples
Get the number of (semi-)automated edits made by Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/automated_editcount/en.wikipedia/Jimbo_Wales
Get a list of the known (semi-)automated tools used by Jimbo Wales in the mainspace on the English Wikipedia, and how many times they were used:
- https://xtools.wmflabs.org/api/user/automated_editcount/en.wikipedia/Jimbo_Wales/0?tools=1
- https://xtools.wmflabs.org/api/user/automated_editcount/en.wikipedia/Jimbo_Wales/0///1
Non-automated edits
/api/user/nonautomated_edits/{project}/{username}/{namespace}/{start}/{end}/{offset}
Get non-automated contributions for the given user, namespace and date range.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
for all namespaces. Defaults to0
(mainspace).start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent contributions.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent contributions.offset
– Shows edits made before this timestamp. This is used for pagination. If you are given more than one page of results,continue
is returned with the offset timestamp as the value.
Examples
Get the latest non-automated mainspace contributions made by Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/nonautomated_edits/en.wikipedia/Jimbo_Wales
- https://xtools.wmflabs.org/api/user/nonautomated_edits/en.wikipedia/Jimbo_Wales/0
Automated edits
/api/user/automated_edits/{project}/{username}/{namespace}/{start}/{end}/{offset}
Get (semi-)automated contributions for the given user, namespace and date range. You can get edits only made with a specific tool by appending ?tool=Tool name
to the end of the URL. To get the names of the available tools, use the Automated tools endpoint.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
for all namespaces. Defaults to0
(mainspace).start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent contributions.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent contributions.offset
– Shows edits made before this timestamp. This is used for pagination. If you are given more than one page of results,continue
is returned with the offset timestamp as the value.
Examples
Get the latest automated mainspace contributions made by Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/automated_edits/en.wikipedia/Jimbo_Wales
- https://xtools.wmflabs.org/api/user/automated_edits/en.wikipedia/Jimbo_Wales/0
Get Twinkle contributions made by Jimbo Wales in the User talk namespace, leading up to the year 2011:
- https://xtools.wmflabs.org/api/user/automated_edits/en.wikipedia/Jimbo_Wales/0//2011-01-01?tool=Twinkle
Edit summaries
/api/user/edit_summaries/{project}/{username}/{namespace}/{start}/{end}
Get statistics about a user’s usage of edit summaries.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
for all namespaces.start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent contributions.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent contributions.
Examples
Get Jimbo Wales’s edit summary statistics for 2010 on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/edit_summaries/en.wikipedia/Jimbo_Wales/all/2010-01-01/2010-12-31
Top edits
/api/user/top_edits/{project}/{username}/{namespace}/{article}
Get the top-edited pages by a user, or get all edits made by a user to a specific page.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.namespace
– Namespace ID orall
for all namespaces. Defaults to0
(mainspace). Leave this blank if you are also supplying a full page title as thearticle
.article
– Full page title ifnamespace
is omitted. If namespace is blank, do not include the namespace in the page title.
Examples
Get the top edits made by Jimbo Wales in the mainspace:
- https://xtools.wmflabs.org/api/user/top_edits/en.wikipedia/Jimbo_Wales
Get the top edits made by Jimbo Wales in the userspace:
- https://xtools.wmflabs.org/api/user/top_edits/en.wikipedia/Jimbo_Wales/2
Get the top edits made by Jimbo Wales to the page Talk:Naveen Jain:
- https://xtools.wmflabs.org/api/user/top_edits/en.wikipedia.org/Jimbo_Wales/1/Naveen_Jain
Category edit counter
/api/user/category_editcount/{project}/{username}/{categories}/{start}/{end}
Get the number of edits made by the given user to the given categories.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.categories
(required) – Category names separated by pipes (|
). The namespace prefix may be omitted.start
– Start date in the formatYYYY-MM-DD
. Leave this and end blank to retrieve the most recent data.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent data.
Examples
Get the number of edits made by Jimbo Wales to Category:Living people and Category:Wikipedia village pump:
- https://xtools.wmflabs.org/api/user/category_editcount/en.wikipedia/Jimbo_Wales/Living_people|Wikipedia_village_pump
Log counts
/api/user/log_counts/{project}/{username}
Get various counts of logged actions made by the user.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.
Examples
Get log counts by Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/log_counts/en.wikipedia/Jimbo_Wales
Month counts
/api/user/month_counts/{project}/{username}
Get the counts of edits made by a user, grouped by namespace ID then year and month.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.
Examples
Get monthly edit count distribution for Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/month_counts/enwiki/Jimbo_Wales
Time card
/api/user/timecard/{project}/{username}
Get the raw number of edits made by a user during each hour of day and day of week. The scale
meanwhile is a value that indicates the number of edits made relative to other hours and days of the week.
Parameters
project
(required) – Project domain or database name.username
(required) – Username or IP address.
Examples
Get time card data for Jimbo Wales on the English Wikipedia:
- https://xtools.wmflabs.org/api/user/timecard/en.wikipedia.org/Jimbo_Wales
Global Contributions
/api/user/globalcontribs/{username}/{namespace}/{start}/{end}/{offset}
Get global edits made by a user, IP or IP range across all Wikimedia projects.
Parameters
username
(required) – Username or IP address.namespace
– Namespace ID orall
(default) for all namespaces.start
– Start date in the formatYYYY-MM-DD
. Leave this andend
blank to retrieve the most recent data.end
– End date in the formatYYYY-MM-DD
. Leave this andstart
blank to retrieve the most recent data.offset
– Shows edits created before the given timestamp. This is used for pagination. If there is more than one page of results,continue
is returned, with the offset timestamp as the value.
Examples
Get edits made by Jimbo Wales across all wikis:
- https://xtools.wmflabs.org/api/user/globalcontribs/Jimbo_Wales