MediaWiki API 帮助

这是自动生成的MediaWiki API文档页面。

文档和例子:https://www.mediawiki.org/wiki/API:Main_page/zh

prop=info (in)

main | query | info
  • 此模块需要读取权限。

获取基本页面信息。

参数:
inprop

要获取的额外属性:

protection
列出每个页面的保护等级。
talkid
The page ID of the talk page for each non-talk page.
watched
列出每个页面的被监视状态。
watchers
监视人员数,如果允许。
notificationtimestamp
The watchlist notification timestamp of each page.
subjectid
The page ID of the parent page for each talk page.
url
Gives a full URL, an edit URL, and the canonical URL for each page.
readable
用户是否可以阅读此页面。
preload
Gives the text returned by EditFormPreloadText.
displaytitle
Gives the way the page title is actually displayed.
值(以|分隔):protection、talkid、watched、watchers、notificationtimestamp、subjectid、url、readable、preload、displaytitle
intestactions

测试当前用户是否可以在页面上执行某种操作。

通过“|”隔开各值。 值的最高数字是50(对于机器人则是500)。
intoken
不推荐使用。

请改用action=query&meta=tokens

值(以|分隔):edit、delete、protect、move、block、unblock、email、import、watch
incontinue

当更多结果可用时,使用这个继续。

例子:
获得有关页面Main Page的信息。
api.php?action=query&prop=info&titles=Main%20Page
获取首页相关的常规和保护信息。
api.php?action=query&prop=info&inprop=protection&titles=Main%20Page

list=categorymembers (cm)

  • 此模块需要读取权限。
  • 此模块可作为发生器使用。

在指定的分类中列出所有页面。

参数:
cmtitle

要列举的分类(必需)。必须包括分类:前缀。不能与cmpageid一起使用。

cmpageid

要枚举的分类的页面 ID。不能与cmtitle一起使用。

cmprop

Which pieces of information to include:

ids
Adds the page ID.
title
Adds the title and namespace ID of the page.
sortkey
Adds the sortkey used for sorting in the category (hexadecimal string).
sortkeyprefix
Adds the sortkey prefix used for sorting in the category (human-readable part of the sortkey).
type
Adds the type that the page has been categorised as (page, subcat or file).
timestamp
Adds the timestamp of when the page was included.
值(以|分隔):ids、title、sortkey、sortkeyprefix、type、timestamp
默认:ids|title
cmnamespace

仅包含这些名字空间的页面。注意cmtype=subcatcmtype=file可能被使用,而不是cmnamespace=146

值(以|分隔):0、1、2、3、4、5、6、7、8、9、10、11、12、13、14、15
cmtype

包含的分类成员类型。当cmsort=timestamp被设置时会忽略。

值(以|分隔):page、subcat、file
默认:page|subcat|file
cmcontinue

当更多结果可用时,使用这个继续。

cmlimit

返回页面的最大数量。

不允许超过500个(对于机器人则是5,000个)。
默认:10
cmsort

要作为排序方式的属性。

一个值:sortkey、timestamp
默认:sortkey
cmdir

排序的方向。

一个值:asc、desc、ascending、descending、newer、older
默认:ascending
cmstart

开始列举的时间戳。只能与cmsort=timestamp一起使用。

cmend

列举的结尾时间戳。只能与cmsort=timestamp一起使用。

cmstarthexsortkey

开始列举的关键词,由cmprop=sortkey返回。不能与cmsort=sortkey一起使用。

cmendhexsortkey

结束列举的关键词,由cmprop=sortkey返回。不能与cmsort=sortkey一起使用。

cmstartsortkeyprefix

Sortkey prefix to start listing from. Can only be used with cmsort=sortkey. Overrides cmstarthexsortkey.

cmendsortkeyprefix

Sortkey prefix to end listing BEFORE (not at, if this value occurs it will not be included!). Can only be used with cmsort=sortkey. Overrides cmendhexsortkey.

cmstartsortkey
不推荐使用。

请改用cmstarthexsortkey。

cmendsortkey
不推荐使用。

请改用cmendhexsortkey。

例子:
获得Category:Physics中的前10个页面。
api.php?action=query&list=categorymembers&cmtitle=Category:Physics
获得有关Category:Physics中的前10个页面的页面信息。
api.php?action=query&generator=categorymembers&gcmtitle=Category:Physics&prop=info