API:Main page

 Attention visitors

This page describes the ongoing efforts to provide an external API to the MediaWiki servers.

MediaWiki at present has four interfaces:
 * MediaWiki API - the new, partially implemented API described on this page.
 * Query API - older API for retrieving data (will be obsolete upon new API completion).
 * Special:Export feature (bulk export of xml formatted data)
 * Regular Web-based interface

The goal of this API is to provide direct, high-level access to the data contained in the MediaWiki databases. Client programs should be able to use the API to login, get data, and post changes. The API must support thin web-based JavaScript clients, such as Navigation popups or LiveRC, end-user applications (such as vandal fighter), or be accessed by another web site (tool server's utilities).

All output will be available in a structured tree format such as XML, JSON, YAML, WDDX, or PHP serialized. A strongly typed RSS or WSDL-style format might also be implemented using wrappers.

Each API module uses a set of parameters. To prevent name collision, each module has a two letter abbreviation, and each parameter name begins with those two letters. For example, the action=login has prefix lg for all of its parameters: "lgname" and "lgpassword".


 * Ask questions and get change notifications: API mailing list
 * View and report API bugs: BugZilla (When reporting new bugs, don't forget to set Component=API)

Areas of the API

 * Output data formats
 * Creating an account and login
 * Getting data from wiki
 * Meta information about the whole site and the logged in user
 * Revisions gets data about page content and revision history
 * Page information about any data contained in a page text itself, such as list of links, templates, categories, interwikies.
 * Listings of pages that match request parameters: all pages, pages in a category.
 * Posting changes to wiki
 * Using API internally by other code
 * Miscellaneous
 * API:Implementation Strategy

Useful Links

 * API source code in SVN
 * Proposed Database Schema Changes
 * Database layout
 * The current DB schema in SVN

Archive

 * API:Wikimania 2006 API discussion