API:Userinfo
Tools
Actions
General
Print/export
In other projects
Appearance
From mediawiki.org
| This page is part of the MediaWiki Action API documentation. |
| MediaWiki Action API |
|---|
| Basics |
| Authentication |
| Accounts and Users |
| Page Operations |
|
| Search |
| Developer Utilities |
| Tutorials |
| v · d · e |
| MediaWiki version: | ≥ 1.11 |
GET request to return information about the currently logged-in user.
API documentation
[edit]| The following documentation is the output of Special: |
meta=userinfo (ui)
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0-or-later
Get information about the current user.
Specific parameters:
Other general parameters are available.
- uiprop
Which pieces of information to include:
- blockinfo
- Tags if the current user is blocked, by whom, and for what reason.
- hasmsg
- Adds a tag messages if the current user has pending messages.
- groups
- Lists all the groups the current user belongs to.
- groupmemberships
- Lists groups that the current user has been explicitly assigned to, including the expiry date of each group membership.
- implicitgroups
- Lists all the groups the current user is automatically a member of.
- rights
- Lists all the rights the current user has.
- changeablegroups
- Lists the groups the current user can add to and remove from.
- options
- Lists all preferences the current user has set.
- editcount
- Adds the current user's edit count.
- ratelimits
- Lists all rate limits applying to the current user.
- theoreticalratelimits
- Lists all rate limits that would apply to the current user if they were not exempt from all ratelimits based on user rights or ip.
- Adds the user's email address and email authentication date.
- realname
- Adds the user's real name.
- acceptlang
- Echoes the
Accept-Languageheader sent by the client in a structured format. - registrationdate
- Adds the user's registration date.
- unreadcount
- Adds the count of unread pages on the user's watchlist (maximum 999; returns 1000+ if more).
- watchlistlabels
- Adds watchlist labels the user has set up.
- centralids
- Adds the central IDs and attachment status for the user.
- latestcontrib
- Adds the date of user's latest contribution.
- cancreateaccount
- Indicates whether the user is allowed to create accounts. To check whether some specific account can be created, use action=query&list=users&usprop=cancreate.
- Values (separate with | or alternative): acceptlang, blockinfo, cancreateaccount, centralids, changeablegroups, editcount, email, groupmemberships, groups, hasmsg, implicitgroups, latestcontrib, options, ratelimits, realname, registrationdate, rights, theoreticalratelimits, unreadcount, watchlistlabels
- To specify all values, use *.
- uiattachedwiki
With uiprop=centralids, indicate whether the user is attached with the wiki identified by this ID.
Examples:
- Get information about the current user.
- api.php?action=query&meta=userinfo [open in sandbox]
- Get additional information about the current user.
- api.php?action=query&meta=userinfo&uiprop=blockinfo|groups|rights|hasmsg [open in sandbox]