API:Query - Meta

From MediaWiki.org

Jump to: navigation, search
This page is part of the MediaWiki API documentation.
MediaWiki API


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 get
    • general: General site information (default)
    • namespaces: A list of all namespaces
    • namespacealiases: A list of all namespace aliases
    • specialpagealiases: A list of all special page aliases
    • statistics: Site statistics à la Special:Statistics
    • interwikimap: A list of all interwiki prefixes and where they go
    • dbrepllag: Get information about the database server with the highest replication lag
    • usergroups: A list of all user groups and their permissions
  • sifilteriw: Criteria to filter the interwiki map by (ignored if siprop=interwikimap isn't set)
    • local: Only list local interwiki prefixes
    • !local: Only list non-local interwiki prefixes
  • sishowalldb: Show information about all DB servers (ignored if siprop=dbrepllag isn'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

[edit] userinfo / ui

MediaWiki version: 1.11

Returns information about the currently logged-in user.

[edit] Parameters

  • uiprop: Which properties to get
    • blockinfo: Whether the current user is blocked, by whom, and why
    • hasmsg: Whether the current user has new messages on their user talk page
    • groups: Which groups the current user belongs to
    • rights: Which rights the current user has
    • options: Which preferences the current user has
    • editcount: The number of edits the current user has made
    • ratelimits: 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

api.php ? action=query & meta=allmessages & ammessages=august|mainpage|edit|rollback-success|thismessagedoesntexist & amlang=nl

<?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.

Personal tools