API:Users
From MediaWiki.org
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| Users | ||
|---|---|---|
This module cannot be used as a Generator. |
||
| Prefix | us | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Get information about a list of users. This module cannot be used as a generator. This module is implemented by ApiQueryUsers.php.
Parameters[edit]
ususers: A list of user names to get information forustoken: Which tokens to get 1.16+ (deprecated in 1.24)userrights: Token for changing a user's group membership
usprop: Which properties to get (Default: none)blockinfo: Whether the user is blocked, by whom and whygroups: All groups the user belongs toimplicitgroups: All groups a user is automatically a member of 1.18+rights: All rights the user has 1.17+editcount: The number of edits the user has maderegistration: The time and date the user registered at 1.13+emailable: Whether the user can and wants to receive e-mail through Special:Emailuser. "emailable" element: if it is missing - user cannot be emailed, if it is present and is an empty string: user can be emailed 1.14+gender: Tags the gender of the user. Returns "male", "female", or "unknown" 1.16+
Example[edit]
Getting information about a list of users
api.php? action=query& list=users& ususers=1.2.3.4|Catrope|Vandal01|Bob& usprop=blockinfo|groups|editcount|registration|emailable|gender [try in ApiSandbox]
| Result |
|---|
<?xml version="1.0"?>
<api>
<query>
<users>
<user name="1.2.3.4" invalid="" />
<user name="Catrope" editcount="153" registration="2007-06-07T16:36:03Z" emailable="" gender="male" />
<user name="Vandal01" missing="" />
<user name="Bob" editcount="4517" registration="2006-11-18T21:55:03Z" emailable="" gender="male">
<groups>
<g>*</g>
<g>user</g>
<g>autoconfirmed</g>
<g>reviewer</g>
</groups>
</user>
</users>
</query>
</api>
|
Error Codes[edit]
None