MediaWiki API 帮助

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

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

action=query

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

获取来自和有关MediaWiki的数据。

所有数据修改将首先要使用查询以获得令牌以阻止来自恶意网站的滥用破坏。

参数:
prop

要为已查询页面获取的属性。

值(以|分隔):categoriescategoryinfocontributorsdeletedrevisionsduplicatefilesextlinksfileusageimageinfoimagesinfoiwlinkslanglinkslinkslinksherepagepropsredirectsrevisionsstashimageinfotemplatestranscludedin
list

要获取的列表。

值(以|分隔):allcategoriesalldeletedrevisionsallfileusagesallimagesalllinksallpagesallredirectsalltransclusionsallusersbacklinksblockscategorymembersdeletedrevsembeddedinexturlusagefilearchiveimageusageiwbacklinkslangbacklinkslogeventspagepropnamespageswithpropprefixsearchprotectedtitlesquerypagerandomrecentchangessearchtagsusercontribsuserswatchlistwatchlistraw
meta

要获取的元数据。

值(以|分隔):allmessagesfilerepoinfositeinfotokensuserinfo
indexpageids

Include an additional pageids section listing all returned page IDs.

export

Export the current revisions of all given or generated pages.

exportnowrap

Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export.

iwurl

Whether to get the full URL if the title is an interwiki link.

continue

When present, formats query-continue as key-value pairs that should simply be merged into the original request. This parameter must be set to an empty string in the initial query.

This parameter is recommended for all new development, and will be made default in the next API version.

rawcontinue

目前被忽略。将来continue将成为默认,且这里将需要得到原始的query-continue数据。

titles

A list of titles to work on.

通过“|”隔开各值。 值的最高数字是50(对于机器人则是500)。
pageids

A list of page IDs to work on.

通过“|”隔开各值。 值的最高数字是50(对于机器人则是500)。
revids

A list of revision IDs to work on.

通过“|”隔开各值。 值的最高数字是50(对于机器人则是500)。
generator

通过执行指定查询模块获得页面列表以工作。

注意:发生器参数名称必须以“g”开头,参见例子。

一个值:allcategoriesalldeletedrevisionsallfileusagesallimagesalllinksallpagesallredirectsalltransclusionsbacklinkscategoriescategorymembersdeletedrevisionsduplicatefilesembeddedinexturlusagefileusageimagesimageusageiwbacklinkslangbacklinkslinkslinksherepageswithpropprefixsearchprotectedtitlesquerypagerandomrecentchangesredirectsrevisionssearchtemplatestranscludedinwatchlistwatchlistraw
redirects

Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.

converttitles

Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion. Languages that support variant conversion include gan、iu、kk、ku、shi、sr、tg、uz、zh.