API:Query - Meta
From MediaWiki.org
| This page is part of the MediaWiki API documentation. |
- Formats
- Error reporting
- Authentication
- Queries
- Meta information
- Properties
- Lists
- Expanding templates and rendering
- Editing
- Using internally
- Miscellaneous
- Implementation
- Client code
Meta queries return information which is not associated with pages.
Contents |
[edit] siteinfo / si
| MediaWiki version: | 1.9 |
Returns overall site information.
[edit] Parameters
siprop: Which properties to getgeneral: General site information (default)namespaces: A list of all namespacesnamespacealiases: A list of all namespace aliasesspecialpagealiases: A list of all special page aliasesstatistics: Site statistics à la Special:Statisticsinterwikimap: A list of all interwiki prefixes and where they godbrepllag: Get information about the database server with the highest replication lagusergroups: A list of all user groups and their permissions
sifilteriw: Criteria to filter the interwiki map by (ignored ifsiprop=interwikimapisn't set)local: Only list local interwiki prefixes!local: Only list non-local interwiki prefixes
sishowalldb: Show information about all DB servers (ignored ifsiprop=dbrepllagisn't set)
[edit] Example
| General site info |
api.php ? action=query & meta=siteinfo
<?xml version="1.0" encoding="utf-8"?> <api> <query> <general mainpage="Main Page" base="http://en.wikipedia.org/wiki/Main_Page" sitename="Wikipedia" generator="MediaWiki 1.13alpha" rev="37014" case="first-letter" rights="GNU Free Documentation License" lang="en" fallback8bitEncoding="windows-1252" /> </query> </api>
[edit] Possible errors
- code: includeAllDenied
- info: Cannot view all servers info unless $wgShowHostnames is true
[edit] userinfo / ui
| MediaWiki version: | 1.11 |
Returns information about the currently logged-in user.
[edit] Parameters
uiprop: Which properties to getblockinfo: Whether the current user is blocked, by whom, and whyhasmsg: Whether the current user has new messages on their user talk pagegroups: Which groups the current user belongs torights: Which rights the current user hasoptions: Which preferences the current user haseditcount: The number of edits the current user has maderatelimits: Rate limits applying to the current user
[edit] Example
| General user info |
api.php ? action=query & meta=userinfo & uiprop=rights|hasmsg
<?xml version="1.0" encoding="utf-8"?> <api> <query> <userinfo name="Jborme" messages=""> <rights> <r>createaccount</r> <r>read</r> <r>edit</r> <r>createpage</r> <r>createtalk</r> <r>reupload-own</r> <r>read</r> <r>edit</r> <r>createpage</r> <r>createtalk</r> <r>upload</r> <r>minoredit</r> <r>purge</r> <r>reupload</r> <r>move</r> <r>autoconfirmed</r> <r>skipcaptcha</r> <r>emailconfirmed</r> </rights> </userinfo> </query> </api>
[edit] Possible errors
None.
[edit] allmessages / am
| MediaWiki version: | 1.12 |
Lists the contents of all (or a few) interface messages.
[edit] Parameters
- ammessages: Only list these messages
- amfilter: Only list messages whose name contains this string
- amlang: Translate messages to this language
[edit] Example
| Get the Dutch translations of some messages |
<?xml version="1.0" encoding="utf-8"?> <api> <query> <allmessages> <message name="august">augustus</message> <message name="mainpage">Hoofdpagina</message> <message name="edit">Bewerken</message> <message name="rollback-success">Wijzigingen door $1 teruggedraaid; laatste versie van $2 hersteld.</message> <message name="thismessagedoesntexist" missing="" /> </allmessages> </query> </api>
[edit] Possible errors
None.

