MediaWiki API 說明

此頁為自動產生的 MediaWiki API 說明文件頁面。

說明文件與範例:https://www.mediawiki.org/wiki/API

list=categorymembers <pre>(cm) </pre>

(main | query | categorymembers)
  • 此模組需要讀取權限。
  • 此模块可作为发生器使用。
  • 来源:MediaWiki
  • 许可协议:GPL-2.0+

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

參數:
cmtitle

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

cmpageid

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

类型:整数
cmprop

要包含的信息束:

ids
添加页面ID。
title
添加页面标题和名字空间ID。
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、2300、2301、2302、2303
cmtype

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

多值 (以 | 分隔):page、subcat、file
預設值:page|subcat|file
cmcontinue

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

cmlimit

回傳的頁面數量上限。

不允許超過 500 (機器人為 5,000)。
类型:整数或max
預設值: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

要开始列举的排序关键词前缀。只能与cmsort=sortkey一起使用。覆盖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