Title: MediaWiki API help - freem URL Source: https://freemwiki.com/api.php Markdown Content: This is an auto-generated MediaWiki API documentation page. Documentation and examples: [https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page](https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page) ## Main module * Source: MediaWiki * License: [GPL-2.0-or-later](https://freemwiki.com/wiki/Special:Version/License/MediaWiki "Special:Version/License/MediaWiki") **Status:** The MediaWiki API is a mature and stable interface that is actively supported and improved. While we try to avoid it, we may occasionally need to make breaking changes; subscribe to [the mediawiki-api-announce mailing list](https://lists.wikimedia.org/hyperkitty/list/mediawiki-api-announce@lists.wikimedia.org/) 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 [API: Errors and warnings](https://www.mediawiki.org/wiki/Special:MyLanguage/API:Errors_and_warnings "mw:Special:MyLanguage/API:Errors and warnings"). **Testing:** For ease of testing API requests, see [Special:ApiSandbox](https://freemwiki.com/wiki/Special:ApiSandbox "Special:ApiSandbox"). Specific parameters: action Which action to perform. [abusefiltercheckmatch](https://freemwiki.com/api.php?action=help&modules=abusefiltercheckmatch)Check to see if an AbuseFilter matches a set of variables, an edit, or a logged AbuseFilter event.[abusefilterchecksyntax](https://freemwiki.com/api.php?action=help&modules=abusefilterchecksyntax)Check syntax of an AbuseFilter filter.[abusefilterevalexpression](https://freemwiki.com/api.php?action=help&modules=abusefilterevalexpression)Evaluates an AbuseFilter expression.[abusefilterunblockautopromote](https://freemwiki.com/api.php?action=help&modules=abusefilterunblockautopromote)Unblocks a user from receiving autopromotions due to an abusefilter consequence.[abuselogprivatedetails](https://freemwiki.com/api.php?action=help&modules=abuselogprivatedetails)View private details of an AbuseLog entry.[acquiretempusername](https://freemwiki.com/api.php?action=help&modules=acquiretempusername)Acquire a temporary user username and stash it in the current session, if temp account creation is enabled and the current user is logged out. If a name has already been stashed, returns the same name.[block](https://freemwiki.com/api.php?action=help&modules=block)Block a user.[changeauthenticationdata](https://freemwiki.com/api.php?action=help&modules=changeauthenticationdata)Change authentication data for the current user.[changecontentmodel](https://freemwiki.com/api.php?action=help&modules=changecontentmodel)Change the content model of a page[checktoken](https://freemwiki.com/api.php?action=help&modules=checktoken)Check the validity of a token from [action=query&meta=tokens](https://freemwiki.com/api.php?action=help&modules=query%2Btokens).[clearhasmsg](https://freemwiki.com/api.php?action=help&modules=clearhasmsg)Clears the `hasmsg` flag for the current user.[clientlogin](https://freemwiki.com/api.php?action=help&modules=clientlogin)Log in to the wiki using the interactive flow.[compare](https://freemwiki.com/api.php?action=help&modules=compare)Get the difference between two pages.[createaccount](https://freemwiki.com/api.php?action=help&modules=createaccount)Create a new user account.[delete](https://freemwiki.com/api.php?action=help&modules=delete)Delete a page.[edit](https://freemwiki.com/api.php?action=help&modules=edit)Create and edit pages.[emailuser](https://freemwiki.com/api.php?action=help&modules=emailuser)Email a user.[expandtemplates](https://freemwiki.com/api.php?action=help&modules=expandtemplates)Expands all templates within wikitext.[feedcontributions](https://freemwiki.com/api.php?action=help&modules=feedcontributions)Returns a user's contributions feed.[feedrecentchanges](https://freemwiki.com/api.php?action=help&modules=feedrecentchanges)Returns a recent changes feed.[feedwatchlist](https://freemwiki.com/api.php?action=help&modules=feedwatchlist)Returns a watchlist feed.[filerevert](https://freemwiki.com/api.php?action=help&modules=filerevert)Revert a file to an old version.[globalblock](https://freemwiki.com/api.php?action=help&modules=globalblock)Globally block or unblock a user.[help](https://freemwiki.com/api.php?action=help&modules=help)Display help for the specified modules.[imagerotate](https://freemwiki.com/api.php?action=help&modules=imagerotate)Rotate one or more images.[import](https://freemwiki.com/api.php?action=help&modules=import)Import a page from another wiki, or from an XML file.[jsonconfig](https://freemwiki.com/api.php?action=help&modules=jsonconfig)Allows direct access to JsonConfig subsystem.[languagesearch](https://freemwiki.com/api.php?action=help&modules=languagesearch)Search for language names in any script.[linkaccount](https://freemwiki.com/api.php?action=help&modules=linkaccount)Link an account from a third-party provider to the current user.[login](https://freemwiki.com/api.php?action=help&modules=login)Log in and get authentication cookies.[logout](https://freemwiki.com/api.php?action=help&modules=logout)Log out and clear session data.[managetags](https://freemwiki.com/api.php?action=help&modules=managetags)Perform management tasks relating to change tags.[mergehistory](https://freemwiki.com/api.php?action=help&modules=mergehistory)Merge page histories.[move](https://freemwiki.com/api.php?action=help&modules=move)Move a page.[opensearch](https://freemwiki.com/api.php?action=help&modules=opensearch)Search the wiki using the OpenSearch protocol.[options](https://freemwiki.com/api.php?action=help&modules=options)Change preferences of the current user.[paraminfo](https://freemwiki.com/api.php?action=help&modules=paraminfo)Obtain information about API modules.[parse](https://freemwiki.com/api.php?action=help&modules=parse)Parses content and returns parser output.[patrol](https://freemwiki.com/api.php?action=help&modules=patrol)Patrol a page or revision.[protect](https://freemwiki.com/api.php?action=help&modules=protect)Change the protection level of a page.[purge](https://freemwiki.com/api.php?action=help&modules=purge)Purge the cache for the given titles.[query](https://freemwiki.com/api.php?action=help&modules=query)Fetch data from and about MediaWiki.[removeauthenticationdata](https://freemwiki.com/api.php?action=help&modules=removeauthenticationdata)Remove authentication data for the current user.[resetpassword](https://freemwiki.com/api.php?action=help&modules=resetpassword)Send a password reset email to a user.[revisiondelete](https://freemwiki.com/api.php?action=help&modules=revisiondelete)Delete and undelete revisions.[rollback](https://freemwiki.com/api.php?action=help&modules=rollback)Undo the last edit to the page.[rsd](https://freemwiki.com/api.php?action=help&modules=rsd)Export an RSD (Really Simple Discovery) schema.[setnotificationtimestamp](https://freemwiki.com/api.php?action=help&modules=setnotificationtimestamp)Update the notification timestamp for watched pages.[setpagelanguage](https://freemwiki.com/api.php?action=help&modules=setpagelanguage)Change the language of a page.[spamblacklist](https://freemwiki.com/api.php?action=help&modules=spamblacklist)Validate one or more URLs against the spam block list.[tag](https://freemwiki.com/api.php?action=help&modules=tag)Add or remove change tags from individual revisions or log entries.[templatedata](https://freemwiki.com/api.php?action=help&modules=templatedata)Fetch data stored by the TemplateData extension.[titleblacklist](https://freemwiki.com/api.php?action=help&modules=titleblacklist)Validate a page title, filename, or username against the TitleBlacklist.[unblock](https://freemwiki.com/api.php?action=help&modules=unblock)Unblock a user.[undelete](https://freemwiki.com/api.php?action=help&modules=undelete)Undelete revisions of a deleted page.[unlinkaccount](https://freemwiki.com/api.php?action=help&modules=unlinkaccount)Remove a linked third-party account from the current user.[upload](https://freemwiki.com/api.php?action=help&modules=upload)Upload a file, or get the status of pending uploads.[userrights](https://freemwiki.com/api.php?action=help&modules=userrights)Change a user's group membership.[validatepassword](https://freemwiki.com/api.php?action=help&modules=validatepassword)Validate a password against the wiki's password policies.[watch](https://freemwiki.com/api.php?action=help&modules=watch)Add or remove pages from the current user's watchlist.[webapp-manifest](https://freemwiki.com/api.php?action=help&modules=webapp-manifest)Returns a webapp manifest.[categorytree](https://freemwiki.com/api.php?action=help&modules=categorytree)Internal. Internal module for the CategoryTree extension.[cspreport](https://freemwiki.com/api.php?action=help&modules=cspreport)Internal. Used by browsers to report violations of the Content Security Policy. This module should never be used, except when used automatically by a CSP compliant web browser.[editcheckreferenceurl](https://freemwiki.com/api.php?action=help&modules=editcheckreferenceurl)Internal. Check the status of a URL for use as a reference.[jsondata](https://freemwiki.com/api.php?action=help&modules=jsondata)Internal. Retrieve localized JSON data.[scribunto-console](https://freemwiki.com/api.php?action=help&modules=scribunto-console)Internal. Internal module for servicing XHR requests from the Scribunto console.[stashedit](https://freemwiki.com/api.php?action=help&modules=stashedit)Internal. Prepare an edit in shared cache.[ulslocalization](https://freemwiki.com/api.php?action=help&modules=ulslocalization)Internal. Get the localization of ULS in the given language.[ulssetlang](https://freemwiki.com/api.php?action=help&modules=ulssetlang)Internal. Update user's preferred interface language.[visualeditor](https://freemwiki.com/api.php?action=help&modules=visualeditor)Internal. Returns HTML5 for a page from the Parsoid service.[visualeditoredit](https://freemwiki.com/api.php?action=help&modules=visualeditoredit)Internal. Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service).One of the following values: [abusefiltercheckmatch](https://freemwiki.com/api.php?action=help&modules=abusefiltercheckmatch), [abusefilterchecksyntax](https://freemwiki.com/api.php?action=help&modules=abusefilterchecksyntax), [abusefilterevalexpression](https://freemwiki.com/api.php?action=help&modules=abusefilterevalexpression), [abusefilterunblockautopromote](https://freemwiki.com/api.php?action=help&modules=abusefilterunblockautopromote), [abuselogprivatedetails](https://freemwiki.com/api.php?action=help&modules=abuselogprivatedetails), [acquiretempusername](https://freemwiki.com/api.php?action=help&modules=acquiretempusername), [block](https://freemwiki.com/api.php?action=help&modules=block), [changeauthenticationdata](https://freemwiki.com/api.php?action=help&modules=changeauthenticationdata), [changecontentmodel](https://freemwiki.com/api.php?action=help&modules=changecontentmodel), [checktoken](https://freemwiki.com/api.php?action=help&modules=checktoken), [clearhasmsg](https://freemwiki.com/api.php?action=help&modules=clearhasmsg), [clientlogin](https://freemwiki.com/api.php?action=help&modules=clientlogin), [compare](https://freemwiki.com/api.php?action=help&modules=compare), [createaccount](https://freemwiki.com/api.php?action=help&modules=createaccount), [delete](https://freemwiki.com/api.php?action=help&modules=delete), [edit](https://freemwiki.com/api.php?action=help&modules=edit), [emailuser](https://freemwiki.com/api.php?action=help&modules=emailuser), [expandtemplates](https://freemwiki.com/api.php?action=help&modules=expandtemplates), [feedcontributions](https://freemwiki.com/api.php?action=help&modules=feedcontributions), [feedrecentchanges](https://freemwiki.com/api.php?action=help&modules=feedrecentchanges), [feedwatchlist](https://freemwiki.com/api.php?action=help&modules=feedwatchlist), [filerevert](https://freemwiki.com/api.php?action=help&modules=filerevert), [globalblock](https://freemwiki.com/api.php?action=help&modules=globalblock), [help](https://freemwiki.com/api.php?action=help&modules=help), [imagerotate](https://freemwiki.com/api.php?action=help&modules=imagerotate), [import](https://freemwiki.com/api.php?action=help&modules=import), [jsonconfig](https://freemwiki.com/api.php?action=help&modules=jsonconfig), [languagesearch](https://freemwiki.com/api.php?action=help&modules=languagesearch), [linkaccount](https://freemwiki.com/api.php?action=help&modules=linkaccount), [login](https://freemwiki.com/api.php?action=help&modules=login), [logout](https://freemwiki.com/api.php?action=help&modules=logout), [managetags](https://freemwiki.com/api.php?action=help&modules=managetags), [mergehistory](https://freemwiki.com/api.php?action=help&modules=mergehistory), [move](https://freemwiki.com/api.php?action=help&modules=move), [opensearch](https://freemwiki.com/api.php?action=help&modules=opensearch), [options](https://freemwiki.com/api.php?action=help&modules=options), [paraminfo](https://freemwiki.com/api.php?action=help&modules=paraminfo), [parse](https://freemwiki.com/api.php?action=help&modules=parse), [patrol](https://freemwiki.com/api.php?action=help&modules=patrol), [protect](https://freemwiki.com/api.php?action=help&modules=protect), [purge](https://freemwiki.com/api.php?action=help&modules=purge), [query](https://freemwiki.com/api.php?action=help&modules=query), [removeauthenticationdata](https://freemwiki.com/api.php?action=help&modules=removeauthenticationdata), [resetpassword](https://freemwiki.com/api.php?action=help&modules=resetpassword), [revisiondelete](https://freemwiki.com/api.php?action=help&modules=revisiondelete), [rollback](https://freemwiki.com/api.php?action=help&modules=rollback), [rsd](https://freemwiki.com/api.php?action=help&modules=rsd), [setnotificationtimestamp](https://freemwiki.com/api.php?action=help&modules=setnotificationtimestamp), [setpagelanguage](https://freemwiki.com/api.php?action=help&modules=setpagelanguage), [spamblacklist](https://freemwiki.com/api.php?action=help&modules=spamblacklist), [tag](https://freemwiki.com/api.php?action=help&modules=tag), [templatedata](https://freemwiki.com/api.php?action=help&modules=templatedata), [titleblacklist](https://freemwiki.com/api.php?action=help&modules=titleblacklist), [unblock](https://freemwiki.com/api.php?action=help&modules=unblock), [undelete](https://freemwiki.com/api.php?action=help&modules=undelete), [unlinkaccount](https://freemwiki.com/api.php?action=help&modules=unlinkaccount), [upload](https://freemwiki.com/api.php?action=help&modules=upload), [userrights](https://freemwiki.com/api.php?action=help&modules=userrights), [validatepassword](https://freemwiki.com/api.php?action=help&modules=validatepassword), [watch](https://freemwiki.com/api.php?action=help&modules=watch), [webapp-manifest](https://freemwiki.com/api.php?action=help&modules=webapp-manifest), [categorytree](https://freemwiki.com/api.php?action=help&modules=categorytree), [cspreport](https://freemwiki.com/api.php?action=help&modules=cspreport), [editcheckreferenceurl](https://freemwiki.com/api.php?action=help&modules=editcheckreferenceurl), [jsondata](https://freemwiki.com/api.php?action=help&modules=jsondata), [scribunto-console](https://freemwiki.com/api.php?action=help&modules=scribunto-console), [stashedit](https://freemwiki.com/api.php?action=help&modules=stashedit), [ulslocalization](https://freemwiki.com/api.php?action=help&modules=ulslocalization), [ulssetlang](https://freemwiki.com/api.php?action=help&modules=ulssetlang), [visualeditor](https://freemwiki.com/api.php?action=help&modules=visualeditor), [visualeditoredit](https://freemwiki.com/api.php?action=help&modules=visualeditoredit)Default: help format The format of the output. [json](https://freemwiki.com/api.php?action=help&modules=json)Output data in JSON format.[jsonfm](https://freemwiki.com/api.php?action=help&modules=jsonfm)Output data in JSON format (pretty-print in HTML).[none](https://freemwiki.com/api.php?action=help&modules=none)Output nothing.[php](https://freemwiki.com/api.php?action=help&modules=php)Output data in serialized PHP format.[phpfm](https://freemwiki.com/api.php?action=help&modules=phpfm)Output data in serialized PHP format (pretty-print in HTML).[rawfm](https://freemwiki.com/api.php?action=help&modules=rawfm)Output data, including debugging elements, in JSON format (pretty-print in HTML).[xml](https://freemwiki.com/api.php?action=help&modules=xml)Output data in XML format.[xmlfm](https://freemwiki.com/api.php?action=help&modules=xmlfm)Output data in XML format (pretty-print in HTML).One of the following values: [json](https://freemwiki.com/api.php?action=help&modules=json), [jsonfm](https://freemwiki.com/api.php?action=help&modules=jsonfm), [none](https://freemwiki.com/api.php?action=help&modules=none), [php](https://freemwiki.com/api.php?action=help&modules=php), [phpfm](https://freemwiki.com/api.php?action=help&modules=phpfm), [rawfm](https://freemwiki.com/api.php?action=help&modules=rawfm), [xml](https://freemwiki.com/api.php?action=help&modules=xml), [xmlfm](https://freemwiki.com/api.php?action=help&modules=xmlfm)Default: jsonfm maxlag 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 [Manual: Maxlag parameter](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Maxlag_parameter "mw:Special:MyLanguage/Manual:Maxlag parameter") for more information. Type: integer smaxage Set the `s-maxage` HTTP cache control header to this many seconds. Errors are never cached. Type: integer The value must be no less than 0.Default: 0 maxage Set the `max-age` HTTP cache control header to this many seconds. Errors are never cached. Type: integer The value must be no less than 0.Default: 0 assert Verify that the user is logged in (including possibly as a temporary user) if set to user, _not_ logged in if set to anon, or has the bot user right if bot. One of the following values: anon, bot, user assertuser Verify the current user is the named user. Type: user, by any of username and Temporary user requestid Any value given here will be included in the response. May be used to distinguish requests. servedby Include the hostname that served the request in the results. Type: boolean ([details](https://freemwiki.com/api.php#main/datatype/boolean))curtimestamp Include the current timestamp in the result. Type: boolean ([details](https://freemwiki.com/api.php#main/datatype/boolean))responselanginfo Include the languages used for uselang and errorlang in the result. Type: boolean ([details](https://freemwiki.com/api.php#main/datatype/boolean))origin 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 `Origin` header exactly, so it has to be set to something like [https://en.wikipedia.org](https://en.wikipedia.org/) or [https://meta.wikimedia.org](https://meta.wikimedia.org/). If this parameter does not match the `Origin` header, a 403 response will be returned. If this parameter matches the `Origin` header and the origin is allowed, the `Access-Control-Allow-Origin` and `Access-Control-Allow-Credentials` headers will be set. For non-authenticated requests, specify the value *. This will cause the `Access-Control-Allow-Origin` header to be set, but `Access-Control-Allow-Credentials` will be `false` and all user-specific data will be restricted. uselang Language to use for message translations. [action=query&meta=siteinfo&siprop=languages](https://freemwiki.com/api.php?action=help&modules=query%2Bsiteinfo) returns a list of language codes. You can specify user to use the current user's language preference or content to use this wiki's content language. Default: user variant Variant of the language. Only works if the base language supports variant conversion. errorformat Format to use for warning and error text output plaintext Wikitext with HTML tags removed and entities replaced.wikitext Unparsed wikitext.html HTML raw Message key and parameters.none No text output, only the error codes.bc Format used prior to MediaWiki 1.29. errorlang and errorsuselocal are ignored.One of the following values: bc, html, none, plaintext, raw, wikitext Default: bc errorlang Language to use for warnings and errors. [action=query&meta=siteinfo&siprop=languages](https://freemwiki.com/api.php?action=help&modules=query%2Bsiteinfo) returns a list of language codes. Specify content to use this wiki's content language or uselang to use the same value as the uselang parameter. Default: uselang errorsuselocal If given, error texts will use locally-customized messages from the MediaWiki namespace. Type: boolean ([details](https://freemwiki.com/api.php#main/datatype/boolean)) Permission: apihighlimits Use higher limits in API queries (slow queries: 500; fast queries: 5000). The limits for slow queries also apply to multivalue parameters.Granted to: bot and sysop ### 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 [edits](https://freemwiki.com/api.php?action=help&modules=edit) with MD5 checks) to fail. 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. Some parameter types in API requests need further explanation: boolean 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. expiry Expiry values may be relative (e.g. 5 months or 2 weeks) or absolute (e.g. 2014-09-18T12:34:56Z). For no expiry, use infinite, indefinite, infinity or never. timestamp Timestamps may be specified in several formats, see [the Timestamp library input formats documented on mediawiki.org](https://www.mediawiki.org/wiki/Special:MyLanguage/Timestamp "mw:Special:MyLanguage/Timestamp") for details. ISO 8601 date and time is recommended: 2001-01-15 T 14:56:00 Z. Additionally, the string now may be used to specify the current timestamp. ### Templated parameters Templated parameters support cases where an API module needs a value for each value of some other parameter. For example, if there were an API module to request fruit, it might have a parameter fruits to specify which fruits are being requested and a templated parameter {fruit}-quantity to specify how many of each fruit to request. An API client that wants 1 apple, 5 bananas, and 20 strawberries could then make a request like fruits=apples|bananas|strawberries&apples-quantity=1&bananas-quantity=5&strawberries-quantity=20. ### Credits API developers: * Yuri Astrakhan (creator, lead developer Sep 2006–Sep 2007) * Roan Kattouw (lead developer Sep 2007–2009) * Victor Vasiliev * Bryan Tong Minh * Sam Reed * Brad Jorsch (lead developer 2013–2020) Please send your comments, suggestions and questions to mediawiki-api@lists.wikimedia.org or file a bug report at [https://phabricator.wikimedia.org/](https://phabricator.wikimedia.org/).