API:Properties/zh

在采用查询（ ）动作时，通过 参数选择需要获取指定页面的哪些属性大类，然后用 参数指定具体的属性. 可以与 =,  =, or  =等参数连用，或使用生成器.

参数的值可以为 、  、 、 、  、 、  、 、  、 、  、  ，或以上几项的组合（如 ）.

例如[//zh.wikipedia.org/w/api.php?action=query&titles=%E5%85%AD%E5%9B%9B%E4%BA%8B%E4%BB%B6&prop=info|revisions&inprop=protection%7Ctalkid&rvprop=comment&format=xml prop=info|revision&inprop=protection|talkid&rvprop=comment]表示获取页面 属性大类里的 和 属性，以及 属性大类里的 属性.

info
Retrieves basic 页面 information. The code for retrieving 页面 属性 is located on the git repository at.

Info: 参数

 * : Which 属性 to get
 * : The protection level
 * : The 页面 ID of the talk 页面 for each non-talk 页面
 * : The 页面 ID of the parent 页面 for each talk 页面
 * : The full and edit  for each 页面
 * : Include the text returned by EditFormPreloadText.
 * : Indicates whether or not the 页面 is being watched by you. (It returns an empty string if you watch the 页面 and the key is missing from answer if you don't watch it.)
 * By default, the following 属性 will be listed:
 * : 页面 ID.
 * : namespace.
 * : title.
 * : page_touched timestamp.
 * : last revision ID.
 * : If $wgDisableCounters is false, gives number of views. Otherwise, gives empty attribute. (note that $wgDisableCounters is set to true on Wikimedia servers.)
 * : 页面 size.
 * : whether the 页面 is a redirect.
 * : whether the 页面 has only one revision.
 * : Which token to get
 * : Get a token for 页面 edit
 * : Get a token for 页面 move
 * : Get a token for 页面 deletion
 * : When more results are available, use this to continue
 * When the result is bigger than $wgAPIMaxResultSize

Info: Possible warnings

 * Action ' action ' is not allowed for the current user
 * Thrown when a token is requested that the current user isn't allowed to use
 * No support for special 页面 has been implemented
 * Thrown when a special 页面 is requested

Info: Possible errors
None

历史记录（revisions）
获取页面的修订记录或页面的最新版本. When using 参数 marked as (enum),  must have only one title listed. The code for this query is located on the git repository at

参数

 * : 获取修订记录的哪些属性. 如果本参数被省略，则以下带有（默认）标记的属性会被列出.
 * : Get both of these IDs: revid, parentid （默认）
 * : Whether the revision was a minor edit （默认）
 * : The date and time the revision was made （默认）
 * : The user who made the revision, as well as userhidden and anon flags （默认）
 * : User id of revision creator, as well as userhidden and anon flags
 * : SHA-1 (base 16) of the revision
 * : The edit comment （默认）
 * : The edit/log comment in HTML format with wikilinks and section references expanded into hyperlinks (. Added in )
 * : 该修订版本的长度，以字节为单位
 * : The revision content. If set, the maximum limit will be 10 times as low
 * : any tags for this revision, such as those added by AbuseFilter.
 * : When more results are available, use this to continue. This can be used, for 例子, for fetching the text of all revisions of a 页面 (although an XML export might be more efficient).
 * : The maximum number of revisions to return. Use the string "max" to return all revisions (subject to being broken up as usual, using continue). Limited by query limits defined in ApiBase, which equals 500 for users and 5000 for bots. (enum)
 * : Revision ID to start listing from. (enum)
 * : Revision ID to stop listing at. (enum)
 * : 返回从指定的时间到更早的时间的修订版本列表. 如果那时该页面尚不存在，则返回值不含 节点. (enum)
 * : Timestamp to end listing at. (enum)
 * : Direction to list in. (enum)
 * : List newest revisions first (default) NOTE: rvstart/rvstartid has to be higher than rvend/rvendid
 * : List oldest revisions first NOTE: rvstart/rvstartid has to be lower than rvend/rvendid
 * : Only list revisions made by this user
 * : Do not list revisions made by this user
 * : Expand templates in  output
 * : Generate XML parse tree for revision content
 * : Parse revision content. For performance reasons if this option is used, rvlimit is enforced to 1.
 * : 获取页面内容的时候（ ），只获取指定章节的内容. 值为章节的索引号，从0开始. 可以用api.php?action=parse&prop=sections获取所有章节. 如果为空字符串，则认为是0.
 * : Tokens to get for each revision
 * : Rollback token
 * : Revision ID to diff each revision to. Use "prev", "next" and "cur" for the previous, next and current revision respectively.
 * : Text to diff each revision to. Only diffs a limited number of revisions. Overrides diffto. If rvsection is set, only that section will be diffed against this text.

Revisions: Possible warnings

 * Action ' action ' is not allowed for the current user
 * Thrown when a token is requested that the current user isn't allowed to use
 * No support for special 页面 has been implemented
 * Thrown when a special 页面 is requested

Revisions: Possible errors

 * code: rvrevids
 * info: The revids= parameter may not be used with the list options (limit, startid, endid, dirNewer, start, end).
 * code: rvmultpages
 * info: titles, pageids or a generator was used to supply multiple 页面, but the limit, startid, endid, dirNewer, user, excludeuser, start and end 参数 may only be used on a single 页面.
 * code: rvaccessdenied
 * info: The current user is not allowed to read title
 * code: rvbadparams
 * info: start and startid cannot be used together
 * code: rvbadparams
 * info: end and endid cannot be used together
 * code: rvbadparams
 * info: user and excludeuser cannot be used together
 * code: rvnosuchsection
 * info: There is no section section in rrevid

categories
Gets a list of all categories used on the provided 页面. This module can be used as a generator.

参数

 * : Which 属性 to get (cannot be used with a generator)
 * : The sort key
 * : The date and time the 页面 was added to the category, or the date and time its sortkey was changed last
 * : Which kinds of categories to list. Conflicting options (such as  and  ) cannot be used together.
 * : Only list hidden categories
 * : Don't list hidden categories
 * : Maximum number of results to return
 * : When more results are available, use this to continue
 * : Only list these categories. Useful to check whether a certain 页面 is in a certain category
 * This parameter takes full titles, so the Category: prefix must be used

Possible warnings

 * ' title ' is not a category
 * The title mentioned is not in the Category: namespace

Possible errors

 * code: clshow
 * info: Incorrect parameter - mutually exclusive values may not be supplied

imageinfo
Gets image information for any titles in the image namespace

参数

 * : Which 属性 to get
 * : The time and date of the revision (default)
 * : The user who made the revision (default)
 * : The edit comment
 * : URL of the image
 * : The image's size in bytes, plus width and height. A 页面 count is also returned if the image is in a format that supports multiple 页面.
 * : The image's SHA-1 hash
 * : The image's MIME type
 * : Image metadata, if available. See Manual:File_metadata_handling for information on file metadata handling in MediaWiki
 * : Image metadata from extensions which implement the GetExtendedMetadata hook. Also contains most of, but in a somewhat standardized format.
 * : Archive name (old images only)
 * : How many image revisions to return (1 by default)
 * : Timestamp to start listing from
 * : Timestamp to stop listing at
 * : If  is set, a URL to an image scaled to this width will be returned as well. Old versions of images can't be scaled
 * : Similar to
 * What version of metadata to use. Only affects JPEGs (as of this writing). You usually want this set to latest.
 * What language to fetch extmetadata in. This affects both which translation to fetch, if multiple are available, as well as how things like numbers and various values are formatted.
 * If translations for extmetadata 属性 are available, fetch all of them. The values of the multi-languaged metadata items will be in the multi-language array format. (Which items are multilanguaged might change from image to image.)
 * The thumb parameter string. Allows user to optionally specify other 参数 than width and height (like 页面 number for pdfs). Format of the field varies with image format. PDF uses a format like 页面 - px (e.g. page3-140px ). Its generally the part before the filename in the url of a thumbnail.
 * Only show local images.

langlinks
Gets a list of all language links from the provided 页面 to other languages.

Only returns language links for 50 titles

参数

 * llcontinue: When more results are available, use this to continue
 * lllimit: How many links to return. Default: 10. No more than 500 (5000 for bots) allowed.

Possible errors
None

links
Gets a list of all links on the provided 页面. This module can be used as a generator.

参数

 * : Only list links to 页面 in these namespaces
 * :    How many links to return.  Default: 10. No more than 500 (5000 for bots) allowed.
 * : When more results are available, use this to continue

Possible errors
None

templates
Gets a list of all 页面 (typically templates) transcluded in the provided 页面. This module can be used as a generator.

参数

 * : Only list 页面 in these namespaces
 * : How many templates to return. Default: 10. No more than 500 (5000 for bots) allowed.
 * : When more results are available, use this to continue
 * : Only list these templates. Useful to check whether a certain template is transcluded in a certain 页面

Possible errors
None.

images
''In Query API interface, this command found 页面 that embedded the given image. That function has been renamed to imageusage.

Gets a list of all images used on the provided 页面. This module can be used as a generator.

参数

 * : How many images to return (since MW 1.13 )

Possible errors
None.

extlinks
Gets a list of all external links on the provided 页面

参数

 * : How many links to return. No more than 500 (5000 for bots) allowed. Default: 10.
 * : When more results are available, use this to continue.

Possible errors
None.

categoryinfo
Gets information about categories


 * Note:
 * If the category 页面 exists, but the category has no members, a "categoryinfo" field will not be included in the API response.

参数

 * : When more results are available, use this to continue
 * When the result is bigger than $wgAPIMaxResultSize

Possible errors
None

duplicatefiles
List duplicates of the given files.

参数

 * : How many duplicates to list
 * : When more results are available, use this to continue

Possible errors
None.