User that made the revision. If the user has been revision deleted, a userhidden property will be returned.
userid
User ID of the revision creator. If the user has been revision deleted, a userhidden property will be returned.
size
Length (bytes) of the revision.
slotsize
Length (bytes) of each revision slot.
sha1
SHA-1 (base 16) of the revision. If the content has been revision deleted, a sha1hidden property will be returned.
slotsha1
SHA-1 (base 16) of each revision slot. If the content has been revision deleted, a sha1hidden property will be returned.
contentmodel
Content model ID of each revision slot.
comment
Comment by the user for the revision. If the comment has been revision deleted, a commenthidden property will be returned.
parsedcomment
Parsed comment by the user for the revision. If the comment has been revision deleted, a commenthidden property will be returned.
content
Content of each revision slot. If the content has been revision deleted, a texthidden property will be returned. For performance reasons, if this option is used, arvlimit is enforced to 50.
tags
Tags for the revision.
roles
List content slot roles that exist in the revision.
parsetree
Deprecated. Use action=expandtemplates or action=parse instead. The XML parse tree of revision content (requires content model wikitext). For performance reasons, if this option is used, arvlimit is enforced to 50.
Which revision slots to return data for, when slot-related properties are included in arvprops. If omitted, data from the main slot will be returned in a backwards-compatible format.
Content serialization format used for output of content.
This is a templated parameter. When making the request, {slot} in the parameter's name should be replaced with values of arvslots.
One of the following values: application/json, application/octet-stream, application/unknown, application/x-binary, text/css, text/javascript, text/plain, text/unknown, text/x-wiki, unknown/unknown
arvlimit
Limit how many revisions will be returned. If arvprop=content, arvprop=parsetree, arvdiffto or arvdifftotext is used, the limit is 50. If arvparse is used, the limit is 1.
Type: integer or max
The value must be between 1 and 500.
arvexpandtemplates
Deprecated.
Use action=expandtemplates instead. Expand templates in revision content (requires arvprop=content).
Use action=parse instead. Parse revision content (requires arvprop=content). For performance reasons, if this option is used, arvlimit is enforced to 1.
Only retrieve the content of the section with this identifier.
arvdiffto
Deprecated.
Use action=compare instead. Revision ID to diff each revision to. Use prev, next and cur for the previous, next and current revision respectively. For performance reasons, if this option is used, arvlimit is enforced to 50.
arvdifftotext
Deprecated.
Use action=compare instead. Text to diff each revision to. Only diffs a limited number of revisions. Overrides arvdiffto. If arvsection is set, only that section will be diffed against this text. For performance reasons, if this option is used, arvlimit is enforced to 50.
arvdifftotextpst
Deprecated.
Use action=compare instead. Perform a pre-save transform on the text before diffing it. Only valid when used with arvdifftotext.
Serialization format used for arvdifftotext and expected for output of content.
One of the following values: application/json, application/octet-stream, application/unknown, application/x-binary, text/css, text/javascript, text/plain, text/unknown, text/x-wiki, unknown/unknown
arvuser
Only list revisions by this user.
Type: user, by any of username, IP, Temporary user, interwiki name (e.g. "prefix>ExampleName") and user ID (e.g. "#12345")
arvnamespace
Only list pages in this namespace.
Note: Due to miser mode, using this may result in fewer than arvlimit results returned before continuing; in extreme cases, zero results may be returned.
#This file is auto-generated. See modules.json and autogenerator.py for details#!/usr/bin/python3""" get_allrevisions.py MediaWiki API Demos Demo of `Allrevisions` module: get revision data of multiple pages and users MIT License"""importrequestsS=requests.Session()URL="https://en.wikipedia.org/w/api.php"PARAMS={"action":"query","arvprop":"ids|flags|timestamp","arvuser":"Place holder","list":"allrevisions","format":"json"}R=S.get(url=URL,params=PARAMS)DATA=R.json()ALLREVISIONS=DATA["query"]["allrevisions"]forrevinALLREVISIONS:print(rev)
PHP
<?php//This file is autogenerated. See modules.json and autogenerator.py for details/* get_allrevisions.php MediaWiki API Demos Demo of `Allrevisions` module: get revision data of multiple pages and users MIT License*/$endPoint="https://en.wikipedia.org/w/api.php";$params=["action"=>"query","format"=>"json","list"=>"allrevisions","arvprop"=>"ids|flags|timestamp","arvuser"=>"Place holder"];$url=$endPoint."?".http_build_query($params);$ch=curl_init($url);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);$output=curl_exec($ch);curl_close($ch);$result=json_decode($output,true);foreach($result["query"]["allrevisions"]as$k=>$v){foreach($v["revisions"]as$k=>$v){var_dump($v);}}
JavaScript
//This file is autogenerated. See modules.json and autogenerator.py for details/* get_allrevisions.js MediaWiki API Demos Demo of `Allrevisions` module: get revision data of multiple pages and users MIT License*/varurl="https://en.wikipedia.org/w/api.php";varparams={action:"query",format:"json",list:"allrevisions",arvprop:"ids|flags|timestamp",arvuser:"Place holder"};url=url+"?origin=*";Object.keys(params).forEach(function(key){url+="&"+key+"="+params[key];});fetch(url).then(function(response){returnresponse.json();}).then(function(response){varrevs=response.query.allrevisions;for(varrinrevs){console.log(revs[r]);}}).catch(function(error){console.log(error);});
MediaWiki JS
// This file is autogenerated. See modules.json and autogenerator.py for details/* get_allrevisions.js MediaWiki API Demos Demo of `Allrevisions` module: get revision data of multiple pages and users MIT License*/varparams={action:'query',format:'json',list:'allrevisions',arvprop:'ids|flags|timestamp',arvuser:'Place holder'},api=newmw.Api();api.get(params).done(function(data){varrevs=data.query.allrevisions,r;for(rinrevs){console.log(revs[r]);}});
可能的警告
不能与r######做差异比较:内容被隐藏。
Thrown when the revision has been hidden (e.g., using RevisionDelete or Oversight).