2.3.2. User API¶
API endpoints related to a user.
Note
To ensure performance and stability, most endpoints will return an error if the user has made an exceptionally high number of edits.
2.3.2.1. Simple edit count¶
See also
The MediaWiki Userinfo API.
GET /api/user/simple_editcount/{project}/{username}/{start}/{end}
For the given user, get the user ID, live and deleted edit count, local user groups and global user groups.
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
.end
- End date in the formatYYYY-MM-DD
.
Response notes:
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.
Example:
Get basic statistics about Jimbo Wales on the English Wikipedia.
Get basic statistics about Jimbo Wales, but only during the year of 2014 and within the mainspace.
2.3.2.2. Number of pages created¶
GET /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
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 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.
Example:
Get the number of mainspace, non-redirect pages created by Jimbo Wales on the English Wikipedia.
Get the number of article talk pages created by Jimbo Wales that are redirects.
2.3.2.3. Pages created¶
GET /api/user/pages/{project}/{username}/{namespace}/{redirects}/{deleted}/{start}/{end}/{offset}
Get the 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
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 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 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.
Example:
Get the mainspace, non-redirect pages created by Jimbo Wales on the English Wikipedia.
Get the article talk pages created by Jimbo Wales that are redirects.
2.3.2.4. Automated edit counter¶
GET /api/user/automated_editcount/{project}/{username}/{namespace}/{start}/{end}/{offset}/{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.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.tools
- Set to any truthy value to include the tools that were used and their counts.
Example:
Get the number of (semi-)automated edits made by Jimbo Wales on the English Wikipedia.
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.
2.3.2.5. Non-automated edits¶
GET /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
(required) - Namespace ID orall
for all namespaces. Defaults to0
(mainspace).start
- Start date in the formatYYYY-MM-DD
. Leave this andend
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.
Example:
Get the latest non-automated mainspace contributions made by Jimbo Wales on the English Wikipedia.
2.3.2.6. Automated edits¶
GET /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
(required) - Namespace ID orall
for all namespaces. Defaults to0
(mainspace).start
- Start date in the formatYYYY-MM-DD
. Leave this andend
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.
Example:
Get the latest automated mainspace contributions made by Jimbo Wales on the English Wikipedia.
Get Twinkle contributions made by Jimbo Wales in the User talk namespace, leading up to the year 2011.
2.3.2.7. Automated tools¶
GET /api/user/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:
tag
: A tag that identifies 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.
Parameters:
project
(required) - Project domain or database name.
Example:
Get all the known semi-automated tools used on the English Wikipedia.
2.3.2.8. Edit summaries¶
GET /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
.end
- End date in the formatYYYY-MM-DD
.
Example:
Get Jimbo Wales’s edit summary statistics for 2010 on the English Wikipedia.
2.3.2.9. Top edits¶
GET /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 to the mainspace. Leave this blank if you are also supplying a full page title as thearticle
.article
- Full page title ifnamespace
is omitted. Ifnamespace
is blank, do not include the namespace in the page title.
Example:
Get the top edits made by Jimbo Wales in the mainspace.
Get the top edits made by Jimbo Wales in the userspace.
Get the top edits made by Jimbo Wales to the page Talk:Naveen Jain.
2.3.2.10. Category edit counter¶
GET /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 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.
Example:
Get the number of edits made by Jimbo Wales to Category:Living people and Category:Wikipedia village pump.
2.3.2.11. Log counts¶
GET /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.
Example:
Get log counts by Jimbo Wales on the English Wikipedia.
2.3.2.12. Namespace totals¶
GET /api/user/namespace_totals/{project}/{username}
Get the counts of edits made to each namespace. Only namespaces for which the user has made at least one edit are returned.
Parameters:
project
(required) - Project domain or database name.username
(required) - Username or IP address.
Example:
Get namespace totals for Jimbo Wales on the English Wikipedia.
2.3.2.13. Month counts¶
GET /api/user/month_counts/{project}/{username}
Get the counts of edits made by a user, grouped by namespace then year and month.
Parameters:
project
(required) - Project domain or database name.username
(required) - Username or IP address.
Example:
Get monthly edit count distribution for Jimbo Wales on the English Wikipedia.
2.3.2.14. Time Card¶
GET /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.
Example:
Get time card data for Jimbo Wales on the English Wikipedia.