API:Meta

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • español • 日本語
MediaWiki API

Quick overview:

v · d · e

Meta queries return information which is not associated with pages.

siteinfo / si[edit | edit source]

MediaWiki version: 1.8

Siteinfo returns overall site information. The code for the siteinfo function is located at ApiQuerySiteinfo.php.

Parameters[edit | edit source]

  • siprop: Which properties to get
    • general: General site information (default)
    • namespaces: Provides a list of all namespaces.
      Each namespace is given within its own element, which contains several attributes:
      • id an integer identification number which is unique for each namespace.
      • subpages if present, will always be a null attribute (subpages=""). This attribute indicates that subpages are allowed within the namespace. (MW 1.13+)
      • canonical Provides the canonical namespace name of the namespace, which may or may not be the same as the actual namespace name. For example, all wikis have a "Project:" namespace, but the actual namespace name is normally changed to the name of the wiki (on Wikipedia for example, the "Project:" namespace is "Wikipedia:"). (MW 1.14+)
      • content if present, will always be a null attribute (content=""). This attribute indicates that pages within this namespace should be treated as the main content of the wiki. Pages within namespaces with the content value set are counted for statistical purposes, among other things. (MW 1.16+)
      • case Either "first-letter" or "case-sensitive". If the first letter of the namespace name is capitalized (the default), then the value of this attribute will be "first-letter". Otherwise, the value will be "case-sensitive" in order to indicate that the namespace name in question intentionally does not use a capital first letter. Note: "case-sensitive" is reserved for future use (MW 1.16+)
    • statistics: Site statistics in Special:Statistics, plus job queue (MW 1.11+)
      • Note: For historical reasons, the number of files on the wiki is labelled as images not files. This number refers to uploaded files of all types, not just images.
    • dbrepllag: If sishowalldb is not set, provides information about the database server with the highest replication lag. If sishowalldb is set, shows replication lag for each database server. (MW 1.11+)
    • interwikimap: A list of each interwiki prefix, provided within its own element. (MW 1.11+)
      The attributes provided in each iw element include:
      • prefix Is the prefix of the interwiki link; this is used the same way as a namespace is used when editing.
      • local (if true) A boolean value indicating whether the wiki is in this project.
      • url The URL of the wiki, with "$1" as a placeholder for an article name.
      • language (if defined) The name of the language used by the wiki, derived by Language::fetchLanguageNames() from $wgExtraLanguageNames. (MW 1.13+)
      • wikiid The internal name of the database. (MW 1.18+)
      • api The URL of the file api.php. (MW 1.18+)
    • namespacealiases: A list of all namespace aliases (MW 1.13+)
    • specialpagealiases: A list of all special page aliases (MW 1.13+)
    • usergroups: A list of all user groups and their permissions (MW 1.13+)
    • extensions: A list of extensions installed on the wiki (MW 1.14+) including revision (date and hash) and, if possible, licensing information (MW 1.23+)
    • skins: A list of skins installed on the wiki (MW 1.18+)
    • magicwords: A list of magic words and their aliases (MW 1.14+)
    • fileextensions: A list of file extensions allowed to be uploaded (MW 1.15+)
    • rightsinfo: Get information about the license governing the wiki's content (MW 1.15+)
      • In the best case this will provide:
        • url which is what $wgRightsUrl contains (like a license URL)
        • text which is what $wgRightsText contains (like the license name) and is also provided with general
      • If $wgRightsPage is set, url is the URL to a page whose meaning has to be interpreted separately and is not output by the API
      • The API doesn't output whatever MediaWiki:Copyright contains
    • languages: Get available languages as seen in preferences (MW 1.16+)
  • sifilteriw: Criteria to filter the interwiki map by (ignored if siprop=interwikimap isn't set) (MW 1.11+)
    • 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) (MW 1.11+)
  • sinumberingroup: When set to true and siprop includes usergroups the number of users in each usergroup and the groups it can add/remove are included (MW 1.17+)

Example[edit | edit source]

General site info

Specific site info

Copyright site info

List namespaces and aliases

Possible errors[edit | edit source]

Code Info
includeAllDenied Cannot view all servers info unless $wgShowHostnames is true

userinfo / ui[edit | edit source]

MediaWiki version: 1.11

Returns information about the currently logged-in user. The code for the userinfo function is located at ApiQueryUserInfo.php.

Parameters[edit | edit source]

  • 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
    • changeablegroups: Which groups the current user can add/remove
    • 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
    • realname: User's realname [1.18+]r79433
    • email: Email address and authentication timestamp in ISO 8601 format [1.15+]

Example[edit | edit source]

General user info

Possible errors[edit | edit source]

None.

allmessages / am[edit | edit source]

MediaWiki version: 1.12

Lists the contents of all (or a few) interface messages.

Parameters[edit | edit source]

  • ammessages: Which messages to output. "*" (default) means all messages
  • amprop: Which properties to get, the only (default) prop is "default"
    • When the default is identical to the (custom) message, the prop is not added
  • amenableparser: Set to enable parser, will preprocess the wikitext of message. Will substitute magic words, handle templates etc.
  • amargs: Arguments to be substituted into message
  • amfilter: Return only messages that contain this string
  • amlang: Return messages in this language
  • amfrom: Return messages starting at this message
  • amto: Return messages ending at this message

Example[edit | edit source]

Get the Dutch translations of some messages

Possible errors[edit | edit source]

None.

filerepoinfo / fri[edit | edit source]

MediaWiki version: 1.22

Return meta information about image repositories configured on the wiki.

Parameters[edit | edit source]

  • friprop: Which repository properties to get (there may be more available on some wikis):
    • apiurl: URL to the repository API - helpful for getting image info from the host.
    • name: The key of the repository - used in e.g. $wgForeignFileRepos and imageinfo return values.
    • displayname: The human-readable name of the repository wiki.
    • rooturl: Root URL for image paths.
    • local: Whether that repository is the local one or not.

Example[edit | edit source]

Possible errors[edit | edit source]

Unknown.