The following documentation is the output of Special:ApiHelp/purge, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org).
Maximum number of values is 50 (500 for clients that are allowed higher limits).
revids
A list of revision IDs to work on. Note that almost all query modules will convert revision IDs to the corresponding page ID and work on the latest revision instead. Only prop=revisions uses exact revisions for its response.
Enumerate all existing tracking categories defined in Special:TrackingCategories. A tracking category exists if it contains pages or if its category page exists.
Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion. Languages that support variant conversion include ban, crh, en, gan, iu, ku, mni, sh, shi, sr, tg, tly, uz, wuu, zgh and zh.
#!/usr/bin/python3""" purge_two_pages.py MediaWiki Action API Code Samples Demo of `purge` module: Sending post request to purge two or more pages MIT license"""importrequestsS=requests.Session()URL="https://en.wikipedia.org/w/api.php"PARAMS={"action":"purge","titles":"Main_Page|Nonexistent","format":"json"}R=S.post(url=URL,params=PARAMS)DATA=R.textprint(DATA)
Example 2: Purge first 10 pages in the main namespace
#!/usr/bin/python3""" purge_namespace_pages.py MediaWiki Action API Code Samples Demo of `purge` module: Sending post request to purge first 10 pages in the main namespace MIT license"""importrequestsS=requests.Session()URL="https://en.wikipedia.org/w/api.php"PARAMS={"action":"purge","generator":"allpages","gapnamespace":"0","gaplimit":"10","format":"json"}R=S.post(url=URL,params=PARAMS)DATA=R.textprint(DATA)