メタクエリはページに関連しない情報を返します。
siteinfo / si [edit]
Siteinfo はサイト全体の情報を返します。The code for the siteinfo function is located at ApiQuerySiteinfo.php.
siprop: どのプロパティを取得するか
general: 一般的なサイト情報 (default)
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: Special:Statisticsに従ったサイトの統計情報, plus job queue (MW 1.11+)
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+)
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+)
| 結果 |
| The following content has been placed in a collapsed box for improved usability. |
<?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>
|
| The above content has been placed in a collapsed box for improved usability. |
| 結果 |
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0"?>
<api>
<query>
<statistics pages="25546702" articles="3801962" edits="499158028" images="825487" users="15733405" activeusers="144787" admins="1514" jobs="0" />
</query>
</api>
|
| The above content has been placed in a collapsed box for improved usability. |
| 結果 |
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0"?>
<api>
<query>
<rightsinfo url="//creativecommons.org/licenses/by-sa/3.0/" text="Creative Commons Attribution-Share Alike 3.0 Unported" />
</query>
</api>
|
| The above content has been placed in a collapsed box for improved usability. |
| 結果 |
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0"?>
<api>
<query>
<namespaces>
<ns id="-2" case="first-letter" canonical="Media" xml:space="preserve">Media</ns>
<ns id="-1" case="first-letter" canonical="Special" xml:space="preserve">Special</ns>
<ns id="0" case="first-letter" content="" xml:space="preserve" />
<ns id="1" case="first-letter" subpages="" canonical="Talk" xml:space="preserve">Talk</ns>
<ns id="2" case="first-letter" subpages="" canonical="User" xml:space="preserve">User</ns>
<ns id="3" case="first-letter" subpages="" canonical="User talk" xml:space="preserve">User talk</ns>
<ns id="4" case="first-letter" subpages="" canonical="Project" xml:space="preserve">Wikipedia</ns>
<ns id="5" case="first-letter" subpages="" canonical="Project talk" xml:space="preserve">Wikipedia talk</ns>
<ns id="6" case="first-letter" canonical="File" xml:space="preserve">File</ns>
<ns id="7" case="first-letter" subpages="" canonical="File talk" xml:space="preserve">File talk</ns>
<ns id="8" case="first-letter" canonical="MediaWiki" xml:space="preserve">MediaWiki</ns>
<ns id="9" case="first-letter" subpages="" canonical="MediaWiki talk" xml:space="preserve">MediaWiki talk</ns>
<ns id="10" case="first-letter" subpages="" canonical="Template" xml:space="preserve">Template</ns>
<ns id="11" case="first-letter" subpages="" canonical="Template talk" xml:space="preserve">Template talk</ns>
<ns id="12" case="first-letter" subpages="" canonical="Help" xml:space="preserve">Help</ns>
<ns id="13" case="first-letter" subpages="" canonical="Help talk" xml:space="preserve">Help talk</ns>
<ns id="14" case="first-letter" canonical="Category" xml:space="preserve">Category</ns>
<ns id="15" case="first-letter" subpages="" canonical="Category talk" xml:space="preserve">Category talk</ns>
<ns id="100" case="first-letter" subpages="" canonical="Portal" xml:space="preserve">Portal</ns>
<ns id="101" case="first-letter" subpages="" canonical="Portal talk" xml:space="preserve">Portal talk</ns>
<ns id="108" case="first-letter" subpages="" canonical="Book" xml:space="preserve">Book</ns>
<ns id="109" case="first-letter" subpages="" canonical="Book talk" xml:space="preserve">Book talk</ns>
</namespaces>
<namespacealiases>
<ns id="4" xml:space="preserve">WP</ns>
<ns id="5" xml:space="preserve">WT</ns>
<ns id="6" xml:space="preserve">Image</ns>
<ns id="7" xml:space="preserve">Image talk</ns>
</namespacealiases>
</query>
</api>
|
| The above content has been placed in a collapsed box for improved usability. |
起こり得るエラー [edit]
userinfo / ui [edit]
現在ログインしているユーザーに関する情報を返す。The code for the userinfo function is located at ApiQueryUserInfo.php.
uiprop: どのプロパティを取得するか
blockinfo: 現在のユーザーがだれによって、なぜブロックされているか
hasmsg: 現在のユーザーの会話ページ上に新しいメッセージがあるかどうか
groups: 現在のユーザーが所属しているグループ
rights: 現在のユーザーが所有している権限
changeablegroups: Which groups the current user can add/remove
options: 現在のユーザーが持っているプリファレンス
editcount: 現在のユーザーが行った編集回数
ratelimits: 現在のユーザーに適用されているレートリミット
realname: User's realname [1.18+]r79433
email: Email address and authentication timestamp in ISO 8601 format [1.15+]
| 結果 |
| The following content has been placed in a collapsed box for improved usability. |
<?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>
|
| The above content has been placed in a collapsed box for improved usability. |
起こり得るエラー [edit]
なし。
allmessages / am [edit]
Lists the contents of all (or a few) interface messages.
ammessages: これらのメッセージのみを一覧表示する
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: メッセージ名がこの文字を含むメッセージのみを一覧表示する
amlang: メッセージをこの言語に翻訳する
amfrom: Return messages starting at this message
amto: Return messages ending at this message
| 結果 |
| The following content has been placed in a collapsed box for improved usability. |
<?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>
|
| The above content has been placed in a collapsed box for improved usability. |
起こり得るエラー [edit]
なし。