User:Democratics/Coding sandbox

MediaWiki API help This is an auto-generated MediaWiki API documentation page. Documentation and examples: https://www.mediawiki.org/wiki/API Main module  Source: MediaWiki  License:  GPL-2.0+    Documentation</li> <li> <a href="//www.mediawiki.org/wiki/API:FAQ" class="extiw" title="mw:API:FAQ">FAQ</a></li> <li> <a class="external text" href="https://lists.wikimedia.org/mailman/listinfo/mediawiki-api">Mailing list</a></li> <li> <a class="external text" href="https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce">API Announcements</a></li> <li> <a class="external text" href="https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R">Bugs &amp; requests</a></li></ul> Status: All features shown on this page should be working, but the API is still in active development, and may change at any time. Subscribe to <a class="external text" href="https://lists.wikimedia.org/pipermail/mediawiki-api-announce/">the mediawiki-api-announce mailing list</a> for notice of updates. Erroneous requests: When erroneous requests are sent to the API, an HTTP header will be sent with the key "MediaWiki-API-Error" and then both the value of the header and the error code sent back will be set to the same value. For more information see <a href="//www.mediawiki.org/wiki/API:Errors_and_warnings" class="extiw" title="mw:API:Errors and warnings">API: Errors and warnings</a>. Testing: For ease of testing API requests, see <a href="/wiki/Special:ApiSandbox" title="Special:ApiSandbox">Special:ApiSandbox</a>.

Parameters: <dl><dt> action </dt> Which action to perform. </dd> One of the following values: <a href="/w/api.php?action=help&amp;modules=abusefiltercheckmatch"> abusefiltercheckmatch </a>, <a href="/w/api.php?action=help&amp;modules=abusefilterchecksyntax"> abusefilterchecksyntax </a>, <a href="/w/api.php?action=help&amp;modules=abusefilterevalexpression"> abusefilterevalexpression </a>, <a href="/w/api.php?action=help&amp;modules=abusefilterunblockautopromote"> abusefilterunblockautopromote </a>, <a href="/w/api.php?action=help&amp;modules=addstudents"> addstudents </a>, <a href="/w/api.php?action=help&amp;modules=antispoof"> antispoof </a>, <a href="/w/api.php?action=help&amp;modules=block"> block </a>, <a href="/w/api.php?action=help&amp;modules=bouncehandler"> bouncehandler </a>, <a href="/w/api.php?action=help&amp;modules=categorytree"> categorytree </a>, <a href="/w/api.php?action=help&amp;modules=centralauthtoken"> centralauthtoken </a>, <a href="/w/api.php?action=help&amp;modules=centralnoticechoicedata"> centralnoticechoicedata </a>, <a href="/w/api.php?action=help&amp;modules=centralnoticequerycampaign"> centralnoticequerycampaign </a>, <a href="/w/api.php?action=help&amp;modules=changeauthenticationdata"> changeauthenticationdata </a>, <a href="/w/api.php?action=help&amp;modules=checktoken"> checktoken </a>, <a href="/w/api.php?action=help&amp;modules=cirrus-config-dump"> cirrus-config-dump </a>, <a href="/w/api.php?action=help&amp;modules=cirrus-mapping-dump"> cirrus-mapping-dump </a>, <a href="/w/api.php?action=help&amp;modules=cirrus-settings-dump"> cirrus-settings-dump </a>, <a href="/w/api.php?action=help&amp;modules=clearhasmsg"> clearhasmsg </a>, <a href="/w/api.php?action=help&amp;modules=clientlogin"> clientlogin </a>, <a href="/w/api.php?action=help&amp;modules=compare"> compare </a>, <a href="/w/api.php?action=help&amp;modules=createaccount"> createaccount </a>, <a href="/w/api.php?action=help&amp;modules=cspreport"> cspreport </a>, <a href="/w/api.php?action=help&amp;modules=cxconfiguration"> cxconfiguration </a>, <a href="/w/api.php?action=help&amp;modules=cxdelete"> cxdelete </a>, <a href="/w/api.php?action=help&amp;modules=cxpublish"> cxpublish </a>, <a href="/w/api.php?action=help&amp;modules=cxsave"> cxsave </a>, <a href="/w/api.php?action=help&amp;modules=cxsuggestionlist"> cxsuggestionlist </a>, <a href="/w/api.php?action=help&amp;modules=cxtoken"> cxtoken </a>, <a href="/w/api.php?action=help&amp;modules=delete"> delete </a>, <a href="/w/api.php?action=help&amp;modules=deleteeducation"> deleteeducation </a>, <a href="/w/api.php?action=help&amp;modules=deleteglobalaccount"> deleteglobalaccount </a>, <a href="/w/api.php?action=help&amp;modules=echomarkread"> echomarkread </a>, <a href="/w/api.php?action=help&amp;modules=echomarkseen"> echomarkseen </a>, <a href="/w/api.php?action=help&amp;modules=edit"> edit </a>, <a href="/w/api.php?action=help&amp;modules=editmassmessagelist"> editmassmessagelist </a>, <a href="/w/api.php?action=help&amp;modules=emailuser"> emailuser </a>, <a href="/w/api.php?action=help&amp;modules=enlist"> enlist </a>, <a href="/w/api.php?action=help&amp;modules=expandtemplates"> expandtemplates </a>, <a href="/w/api.php?action=help&amp;modules=fancycaptchareload"> fancycaptchareload </a>, <a href="/w/api.php?action=help&amp;modules=featuredfeed"> featuredfeed </a>, <a href="/w/api.php?action=help&amp;modules=feedcontributions"> feedcontributions </a>, <a href="/w/api.php?action=help&amp;modules=feedrecentchanges"> feedrecentchanges </a>, <a href="/w/api.php?action=help&amp;modules=feedwatchlist"> feedwatchlist </a>, <a href="/w/api.php?action=help&amp;modules=filerevert"> filerevert </a>, <a href="/w/api.php?action=help&amp;modules=flagconfig"> flagconfig </a>, <a href="/w/api.php?action=help&amp;modules=flow"> flow </a>, <a href="/w/api.php?action=help&amp;modules=flow-parsoid-utils"> flow-parsoid-utils </a>, <a href="/w/api.php?action=help&amp;modules=flowthank"> flowthank </a>, <a href="/w/api.php?action=help&amp;modules=globalblock"> globalblock </a>, <a href="/w/api.php?action=help&amp;modules=globaluserrights"> globaluserrights </a>, <a href="/w/api.php?action=help&amp;modules=graph"> graph </a>, <a href="/w/api.php?action=help&amp;modules=help"> help </a>, <a href="/w/api.php?action=help&amp;modules=imagerotate"> imagerotate </a>, <a href="/w/api.php?action=help&amp;modules=import"> import </a>, <a href="/w/api.php?action=help&amp;modules=jsonconfig"> jsonconfig </a>, <a href="/w/api.php?action=help&amp;modules=languagesearch"> languagesearch </a>, <a href="/w/api.php?action=help&amp;modules=linkaccount"> linkaccount </a>, <a href="/w/api.php?action=help&amp;modules=liststudents"> liststudents </a>, <a href="/w/api.php?action=help&amp;modules=login"> login </a>, <a href="/w/api.php?action=help&amp;modules=logout"> logout </a>, <a href="/w/api.php?action=help&amp;modules=managetags"> managetags </a>, <a href="/w/api.php?action=help&amp;modules=massmessage"> massmessage </a>, <a href="/w/api.php?action=help&amp;modules=mergehistory"> mergehistory </a>, <a href="/w/api.php?action=help&amp;modules=mobileview"> mobileview </a>, <a href="/w/api.php?action=help&amp;modules=move"> move </a>, <a href="/w/api.php?action=help&amp;modules=opensearch"> opensearch </a>, <a href="/w/api.php?action=help&amp;modules=options"> options </a>, <a href="/w/api.php?action=help&amp;modules=pagetriageaction"> pagetriageaction </a>, <a href="/w/api.php?action=help&amp;modules=pagetriagelist"> pagetriagelist </a>, <a href="/w/api.php?action=help&amp;modules=pagetriagestats"> pagetriagestats </a>, <a href="/w/api.php?action=help&amp;modules=pagetriagetagging"> pagetriagetagging </a>, <a href="/w/api.php?action=help&amp;modules=pagetriagetemplate"> pagetriagetemplate </a>, <a href="/w/api.php?action=help&amp;modules=paraminfo"> paraminfo </a>, <a href="/w/api.php?action=help&amp;modules=parse"> parse </a>, <a href="/w/api.php?action=help&amp;modules=parsoid-batch"> parsoid-batch </a>, <a href="/w/api.php?action=help&amp;modules=patrol"> patrol </a>, <a href="/w/api.php?action=help&amp;modules=protect"> protect </a>, <a href="/w/api.php?action=help&amp;modules=purge"> purge </a>, <a href="/w/api.php?action=help&amp;modules=query"> query </a>, <a href="/w/api.php?action=help&amp;modules=refresheducation"> refresheducation </a>, <a href="/w/api.php?action=help&amp;modules=removeauthenticationdata"> removeauthenticationdata </a>, <a href="/w/api.php?action=help&amp;modules=resetpassword"> resetpassword </a>, <a href="/w/api.php?action=help&amp;modules=review"> review </a>, <a href="/w/api.php?action=help&amp;modules=reviewactivity"> reviewactivity </a>, <a href="/w/api.php?action=help&amp;modules=revisiondelete"> revisiondelete </a>, <a href="/w/api.php?action=help&amp;modules=rollback"> rollback </a>, <a href="/w/api.php?action=help&amp;modules=rsd"> rsd </a>, <a href="/w/api.php?action=help&amp;modules=sanitize-mapdata"> sanitize-mapdata </a>, <a href="/w/api.php?action=help&amp;modules=scribunto-console"> scribunto-console </a>, <a href="/w/api.php?action=help&amp;modules=setglobalaccountstatus"> setglobalaccountstatus </a>, <a href="/w/api.php?action=help&amp;modules=setnotificationtimestamp"> setnotificationtimestamp </a>, <a href="/w/api.php?action=help&amp;modules=shortenurl"> shortenurl </a>, <a href="/w/api.php?action=help&amp;modules=sitematrix"> sitematrix </a>, <a href="/w/api.php?action=help&amp;modules=spamblacklist"> spamblacklist </a>, <a href="/w/api.php?action=help&amp;modules=stabilize"> stabilize </a>, <a href="/w/api.php?action=help&amp;modules=stashedit"> stashedit </a>, <a href="/w/api.php?action=help&amp;modules=strikevote"> strikevote </a>, <a href="/w/api.php?action=help&amp;modules=tag"> tag </a>, <a href="/w/api.php?action=help&amp;modules=templatedata"> templatedata </a>, <a href="/w/api.php?action=help&amp;modules=thank"> thank </a>, <a href="/w/api.php?action=help&amp;modules=titleblacklist"> titleblacklist </a>, <a href="/w/api.php?action=help&amp;modules=tokens"> tokens </a>, <a href="/w/api.php?action=help&amp;modules=transcodereset"> transcodereset </a>, <a href="/w/api.php?action=help&amp;modules=ulslocalization"> ulslocalization </a>, <a href="/w/api.php?action=help&amp;modules=unblock"> unblock </a>, <a href="/w/api.php?action=help&amp;modules=undelete"> undelete </a>, <a href="/w/api.php?action=help&amp;modules=unlinkaccount"> unlinkaccount </a>, <a href="/w/api.php?action=help&amp;modules=upload"> upload </a>, <a href="/w/api.php?action=help&amp;modules=userrights"> userrights </a>, <a href="/w/api.php?action=help&amp;modules=visualeditor"> visualeditor </a>, <a href="/w/api.php?action=help&amp;modules=visualeditoredit"> visualeditoredit </a>, <a href="/w/api.php?action=help&amp;modules=watch"> watch </a>, <a href="/w/api.php?action=help&amp;modules=wikilove"> wikilove </a>, <a href="/w/api.php?action=help&amp;modules=zeroconfig"> zeroconfig </a></dd> Default: help </dd><dt> format </dt> The format of the output. </dd> One of the following values: <a href="/w/api.php?action=help&amp;modules=json"> json </a>, <a href="/w/api.php?action=help&amp;modules=jsonfm"> jsonfm </a>, <a href="/w/api.php?action=help&amp;modules=none"> none </a>, <a href="/w/api.php?action=help&amp;modules=php"> php </a>, <a href="/w/api.php?action=help&amp;modules=phpfm"> phpfm </a>, <a href="/w/api.php?action=help&amp;modules=rawfm"> rawfm </a>, <a href="/w/api.php?action=help&amp;modules=xml"> xml </a>, <a href="/w/api.php?action=help&amp;modules=xmlfm"> xmlfm </a></dd> Default: jsonfm </dd><dt> maxlag </dt> Maximum lag can be used when MediaWiki is installed on a database replicated cluster. To save actions causing any more site replication lag, this parameter can make the client wait until the replication lag is less than the specified value. In case of excessive lag, error code maxlag is returned with a message like Waiting for $host: $lag seconds lagged. See <a href="//www.mediawiki.org/wiki/Manual:Maxlag_parameter" class="extiw" title="mw:Manual:Maxlag parameter">Manual: Maxlag parameter</a> for more information. </dd> Type: integer</dd><dt> smaxage </dt> Set the  HTTP cache control header to this many seconds. Errors are never cached. </dd> Type: integer</dd> Default: 0 </dd><dt> maxage </dt> Set the  HTTP cache control header to this many seconds. Errors are never cached. </dd> Type: integer</dd> Default: 0 </dd><dt> assert </dt> Verify the user is logged in if set to user, or has the bot user right if bot. </dd> One of the following values: user, bot </dd><dt> assertuser </dt> Verify the current user is the named user. </dd> Type: user name</dd><dt> requestid </dt> Any value given here will be included in the response. May be used to distinguish requests. </dd><dt> servedby </dt> Include the hostname that served the request in the results. </dd> Type: boolean (<a href="#main.2Fdatatypes">details</a>)</dd><dt> curtimestamp </dt> Include the current timestamp in the result. </dd> Type: boolean (<a href="#main.2Fdatatypes">details</a>)</dd><dt> origin </dt> When accessing the API using a cross-domain AJAX request (CORS), set this to the originating domain. This must be included in any pre-flight request, and therefore must be part of the request URI (not the POST body). For authenticated requests, this must match one of the origins in the  header exactly, so it has to be set to something like <a class="external free" href="https://en.wikipedia.org">https://en.wikipedia.org</a> or <a class="external free" href="https://meta.wikimedia.org">https://meta.wikimedia.org</a>. If this parameter does not match the  header, a 403 response will be returned. If this parameter matches the  header and the origin is whitelisted, the   and   headers will be set. For non-authenticated requests, specify the value *. This will cause the  header to be set, but   will be   and all user-specific data will be restricted. </dd><dt> uselang </dt> Language to use for message translations. <a href="/w/api.php?action=help&amp;modules=query%2Bsiteinfo">action=query&amp;meta=siteinfo</a> with siprop=languages returns a list of language codes, or specify user to use the current user's language preference, or specify content to use this wiki's content language. </dd> Default: user </dd><dt> centralauthtoken </dt> When accessing the API using a cross-domain AJAX request (CORS), use this to authenticate as the current SUL user. Use <a href="/w/api.php?action=help&amp;modules=centralauthtoken">action=centralauthtoken</a> on this wiki to retrieve the token, before making the CORS request. Each token may only be used once, and expires after 10 seconds. This should be included in any pre-flight request, and therefore should be included in the request URI (not the POST body). </dd></dl> Examples: <dl><dt>Help for the main module.</dt><dd><a href="/w/api.php?action=help" dir="ltr">api.php?action=help</a> <a href="/wiki/Special:ApiSandbox#action=help"> [open in sandbox] </a></dd><dt>All help in one page.</dt><dd><a href="/w/api.php?action=help&amp;recursivesubmodules=1" dir="ltr">api.php?action=help&amp;recursivesubmodules=1</a> <a href="/wiki/Special:ApiSandbox#action=help&amp;recursivesubmodules=1"> [open in sandbox] </a></dd></dl> Permissions: <dl><dt>writeapi</dt><dd>Use of the write API</dd><dd>Granted to: all, user, bot</dd><dt>apihighlimits</dt><dd>Use higher limits in API queries (slow queries: 500; fast queries: 5000). The limits for slow queries also apply to multivalue parameters.</dd><dd>Granted to: bot, sysop, researcher</dd></dl>

<h3 id="main/datatypes" class="apihelp-header"> Data types Input to MediaWiki should be NFC-normalized UTF-8. MediaWiki may attempt to convert other input, but this may cause some operations (such as <a href="/w/api.php?action=help&amp;modules=edit">edits</a> with MD5 checks) to fail. Some parameter types in API requests need further explanation: <dl><dt>boolean</dt> <dd>Boolean parameters work like HTML checkboxes: if the parameter is specified, regardless of value, it is considered true. For a false value, omit the parameter entirely.</dd> <dt>timestamp</dt> <dd>Timestamps may be specified in several formats. ISO 8601 date and time is recommended. All times are in UTC, any included timezone is ignored. <ul><li> ISO 8601 date and time, 2001 - 01 - 15 T 14 : 56 : 00 Z (punctuation and Z are optional)</li> <li> ISO 8601 date and time with (ignored) fractional seconds, 2001 - 01 - 15 T 14 : 56 : 00. 00001 Z (dashes, colons, and Z are optional)</li> <li> MediaWiki format, 2001 01  15  14  56  00 </li> <li> Generic numeric format, 2001 - 01 - 15 14 : 56 : 00 (optional timezone of GMT, + ## , or - ## is ignored)</li> <li> EXIF format, 2001 : 01 : 15 14 : 56 : 00 </li> <li><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc2822">RFC 2822</a> format (timezone may be omitted), Mon, 15 Jan  2001  14 : 56 : 00 </li> <li> <a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc850">RFC 850</a> format (timezone may be omitted), Monday, 15 - Jan - 2001 14 : 56 : 00 </li> <li> C ctime format, Mon Jan  15  14 : 56 : 00  2001 </li> <li> Seconds since 1970-01-01T00:00:00Z as a 1 to 13 digit integer (excluding 0 )</li> <li> The string now </li></ul></dd></dl><dl><dt>alternative multiple-value separator</dt> <dd>Parameters that take multiple values are normally submitted with the values separated using the pipe character, e.g. param=value1|value2 or param=value1%7Cvalue2. If a value must contain the pipe character, use U+001F (Unit Separator) as the separator and prefix the value with U+001F, e.g. param=%1Fvalue1%1Fvalue2 .</dd></dl><h3 id="main/credits" class="apihelp-header">Credits API developers: <ul><li> Yuri Astrakhan (creator, lead developer Sep 2006–Sep 2007)</li> <li> Roan Kattouw (lead developer Sep 2007–2009)</li> <li> Victor Vasiliev</li> <li> Bryan Tong Minh</li> <li> Sam Reed</li> <li> Brad Jorsch (lead developer 2013–present)</li></ul> Please send your comments, suggestions and questions to mediawiki-api@lists.wikimedia.org or file a bug report at <a class="external free" href="https://phabricator.wikimedia.org/">https://phabricator.wikimedia.org/</a>. (window.RLQ=window.RLQ||[]).push(function{mw.log.warn("Gadget \"Twinkle\" styles loaded twice. Migrate to type=general. See \u003Chttps://phabricator.wikimedia.org/T42284\u003E.");mw.log.warn("Gadget \"teahouse\" styles loaded twice. Migrate to type=general. See \u003Chttps://phabricator.wikimedia.org/T42284\u003E.");mw.log.warn("Gadget \"ReferenceTooltips\" styles loaded twice. Migrate to type=general. See \u003Chttps://phabricator.wikimedia.org/T42284\u003E.");mw.log.warn("Gadget \"edittop\" styles loaded twice. Migrate to type=general. See \u003Chttps://phabricator.wikimedia.org/T42284\u003E.");mw.log.warn("Gadget \"featured-articles-links\" styles loaded twice. Migrate to type=general. See \u003Chttps://phabricator.wikimedia.org/T42284\u003E.");}); Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/wiki/Special:ApiHelp">https://en.wikipedia.org/wiki/Special:ApiHelp</a>"