API:Query - Meta
From MediaWiki.org
| This page is part of the MediaWiki API documentation. |
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 aliases (>MW 1.10)specialpagealiases: A list of all special page aliases (>MW 1.10)magicwords: A list of magic words and their aliases (>MW 1.13)statistics: Site statistics à la Special:Statistics(>MW 1.10)interwikimap: A list of all interwiki prefixes and where they go (>MW 1.10)dbrepllag: Get information about the database server with the highest replication lag(>MW 1.10)usergroups: A list of all user groups and their permissions (>MW 1.10)extensions: A list of extensions installed on the wiki (>MW 1.13)fileextensions: A list of file extensions allowed to be uploaded (>MW 1.13)rightsinfo: Get information about the license governing the wiki's content (>MW 1.13)
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
<?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.16alpha-wmf" phpversion="5.2.4-2ubuntu5wm1" phpsapi="apache2handler" dbtype="mysql" dbversion="4.0.40-wikimedia-log" rev="54192" case="first-letter" rights="Creative Commons Attribution-Share Alike 3.0 Unported" lang="en" fallback8bitEncoding="windows-1252" writeapi="" timezone="UTC" timeoffset="0" articlepath="/wiki/$1" scriptpath="/w" script="/w/index.php" variantarticlepath="" server="http://en.wikipedia.org" wikiid="enwiki" /> </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 haschangeablegroups: Which groups the current user can add/removeoptions: Which preferences the current user haseditcount: The number of edits the current user has maderatelimits: Rate limits applying to the current useremail: Email address and authentication timestamp in ISO 8601 format [1.15+]
[edit] Example
General user info
<?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 messagesamfilter: Only list messages whose name contains this stringamlang: 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.