Code snippets in PHP demonstrating how to use various modules of the MediaWiki Action API
- API:Tokens
- tokens.php: get tokens for data modifying operations
- API:Login
- login.php: login
- API:Logout
- logout.php: logout
- API:Account creation
- create_account.php: create an account on a wiki without any special authentication extensions
- API:Block
- block_user.php: block a user
- API:Blocks
- get_blocked_users.php: get information about recent blocked users
- API:Users
- get_users.php: get information about a list of users
- API:User contributions
- get_usercontribs.php: list user contributions
- API:User group membership
- userrights.php: add and remove user rights
- API:Watchlist feed
- get_my_watchlist_feed.php: access an RSS feed of your own watchlist
- API:Options
- change_user_options.php: change preferences of current user
- API:Emailuser
- send_an_email.php: send an email to user
- API:Watchlist
- get_watchlist.php: get the currently logged-in user's watchlist
- API:Watchlistraw
- get_watchlistraw.php: get three pages on the logged-in user's watchlist from the main namespace
- API:Rsd
- rsd.php: export an RSD schema
- API:Parse
- parse.php: parse content of a page
- API:Categorymembers
- get_category_items.php: list twenty items in a category
- get_recent_category_items.php: get the ten articles most recently added to a category
- get_subcategories.php: get ten subcategories of a category
- API:Categoryinfo
- get_category_info.php: get info about few categories
- API:Images
- get_page_images.php: get page images embedded on a page
- API:Purge
- purge_two_pages.php: purge cache of two or more pages
- purge_namespace_pages.php: purge cache of the first 10 pages in the main namespace
- API:Redirects
- redirects.php: return redirects to the given page(s)
- API:Delete
- delete.php: delete a page
- API:Deletedrevs
- get_deleted_revisions.php: list deleted revisions from a user
- API:Revisions
- get_pages_revisions.php: get revision data of multiple pages
- get_filtered_page_revisions.php: get revision data of a page filtered by date and user
- API:Allrevisions
- get_allrevisions.php: get revision data of multiple pages and users
- API:Alldeletedrevisions
- get_alldeletedrevs.php: get all deleted revision data by a user or in a namespace.
- API:Links
- get_links.php: get links embedded on a page
- get_red_links.php: get the first twenty red links in a page
- API:Info
- get_info.php: get basic information about a page
- API:Allpages
- get_allpages.php: get all pages which fit a certain criteria, within a namespace
- API:Edit
- edit.php: edit a page
- API:Allimages
- get_allimages_by_date.php: list all images in a namespace, starting from a certain timestamp
- get_allimages_by_name.php: list all images in a namespace, starting from a certain filename
- API:Imageinfo
- get_imageinfo.php get information about an image file
- API:Categories
- get_categories.php: get categories associated with a page
- API:Allcategories
- get_allcategories.php: get all categories that fit certain criteria relating to their titles
- API:Allusers
- get_allusers.php: get a list of all registered users, as ordered by username
- API:Backlinks
- get_backlinks.php: list pages which link to a certain page
- API:Random
- get_random.php: get a list of random pages
- API:Move
- move.php: move a page
- API:Watch
- watch.php: add a page to your watchlist
- API:Alllinks
- get_alllinks.php: list links to a namespace
- API:Exturlusage
- get_exturlusage.php: enumerate pages that contain a given URL
- API:RecentChanges
- get_recent_changes.php: get the three most recent changes with sizes and flags
- API:Querypage
- get_querypage_list.php: List first 10 pages which are uncategorized
- API:SetPageLanguage
- set_page_language.php: change page language
- API:Embeddedin
- get_embedded_pages.php: get all page(s) that embed a page
- API:Rollback
- rollback.php: rollback the last edits made to a given page
- API:Allfileusages
- get_allfileusages.php: list of all file usages
- API:Protect
- protect.php: Change the protection level of a given page
- API:Upload
- upload_file_from_url.php: upload a file from a URL
- API:Pagepropnames
- get_pagepropnames.php: List all page property names in use on the wiki
- API:Protectedtitles
- get_protectedtitles.php: List the first 2 titles which only sysops can create
- API:Imageusage
- get_imageusage.php: List the first three pages that use a given image title.
- API:Import
- import_interwiki.php: Import a page from another wiki by specifying its title
- API:Patrol
- patrol.php: Patrol a recent change
- API:Iwlinks
- get_iwlinks.php: get the interwiki links from a given page
- API:Undelete
- undelete.php: restore two revisions of a deleted page
- API:Logevents
- get_logevents.php: get the three most recent log events
- API:Tags
- get_tags.php: get the first three change tags and their hitcounts
- API:Allredirects
- get_allredirects.php: get the first three unique pages containing redirects to the main namespace
- API:Alltransclusions
- get_alltransclusions.php: get three unique pages in the main namespace which contain transclusions
- API:Mergehistory
- mergehistory.php: Merge the page revisions of Oldpage dating up to 2015-12-31T04:37:41Z into Newpage
- API:Contributors
- get_contributors.js: get request to list all logged-in contributors and count of anonymous contributors to a page
- API:Stashedit
- stashedit.php: Prepare an edit in shared cache
- API:Search
- search.php: search for a title or a text
- API:Geosearch
- geosearch.php: search for pages nearby
- geoimagesearch.php: search for pages nearby with images
- geocoordinates.php: obtain coordinates for wiki pages nearby
- API:Opensearch
- opensearch.php: fetch results in an opensearch format
- API:Prefixsearch
- prefixsearch.php: perform a prefix search for page titles
- API:Languagesearch
- languagesearch.php: search for a language
- API:Parameter information
- paraminfo.php: get information about another action API module and its parameters