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:Validatepassword
- validatepassword.php: validate a password against the wiki's password policies
- API:Resetpassword
- reset_password.py: Reset password for all users with an email address.
- API:Feedcontributions
- get_user_contributions_feed.php: Show contributions of a user as an RSS feed.
- API:Userinfo
- userinfo.php: get general user info and user rights
- API:Parse
- parse.php: parse content of a page
- API:Pageswithprop
- get_pageswithprop.php: list all pages using a given page property
- 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:Deletedrevisions
- get_deleted_revs.php: list deleted revisions for a page
- 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:Filearchive
- filearchive.php: Enumerate all deleted files from filearchive table sequentially
- API:Siteinfo
- general_site_info.php: obtain general site info
- API:Expandtemplates
- expand_templates.php: expand the Project:Sandbox template
- API:ClearHasMsg
- clear_has_msg.php: clear the hasmsg flag for the current user
- API:Compare
- compare.php: Compare the current revisions of two different pages
- API:Tag
- tag.php: Remove the spam tag from log entry ID 123 with the reason Wrongly applied
- API:Duplicatefiles
- duplicate_files.php: list duplicates of the given files
- API:Filerepoinfo
- file_repo_info.php: get information about file repositories
- API:Iwbacklinks
- iwbacklinks.php: Get pages that link to a given interwiki link.
- API:Checktoken
- check_token.php: Check a CSRF token
- API:Deletedrevisions
- deleted_revisions.php: Get a list of deleted revisions for Talk:Main Page.
- API:Revisiondelete
- revision_delete.php: Hide all information about a certain revision ID.
- API:Filearchive
- file_archive.php: Get a list of all deleted files.
- API:Fileusage
- get_file_usage.php: Get a list of pages using a given file.
- API:Feedrecentchanges
- get_feed_recent_changes.php: Show recent changes as an RSS feed.
- API:Setnotificationtimestamp
- set_notification_timestamp.php: Reset the notification status for the entire watchlist.
- API:Langbacklinks
- langbacklinks.php: get pages linking to a given language link
- API:Templates
- templates.php: get a list of templates used on a page
- API:Pageprops
- pageprops.php: get various properties defined in the page content
- API:Extlinks
- get_extlinks.php: get a list of external links on a page
- API:Linkshere
- linkshere.php: get a list of pages linking to a given page
- API:Allmessages
- all_messages.php: get the Dutch translations of some messages
- API:Transcludedin
- get_transcluded_in.php: get a list of pages which transclude a given page
- API:Langlinks
- langlinks.php: get a list of language links that a given page has
- API:Stashimageinfo
- stash_image_info.php: return information for a stashed file
- 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
- API:Main_module
- main_module.php: Get help for the main module.
- API:Help
- get_help.php: Get help for a specified module.