API:FAQ

Also read the quick start guide. It answers some questions not answered here and points to other useful pages.

get help?

 * 1) Read this FAQ
 * 2) Try to find the answer to your question in the API documentation here or on the self-documenting API home page
 * 3) If you can't find the answer to your question on the web, you can ask your question on the mediawiki-api mailing list.

file a bug?
If you have found a bug in the API, you can report it on Bugzilla. Be sure to search for existing bugs first (please don't file duplicate bugs) and choose "MediaWiki" for product and "API" for component when reporting a new bug against the API.

call the API?
The API is called by sending HTTP requests to api.php. For English Wikipedia, the URL is http://en.wikipedia.org/w/api.php ; other wikis have api.php at analogous URLs. If you're trying to access the API on a third-party (non-Wikimedia-operated) wiki and can't figure out the URL of api.php, contact the wiki's owner.

control the output format?
Pass  in the query string. See the list of output formats for more information.

get the content of a page (wikitext)?
If you just want the raw wikitext without any other information whatsoever, it's best to use index.php's action=raw mode instead of the API: http://en.wikipedia.org/w/index.php?action=raw&title=Main_Page. Note that this'll just plain wikitext without any formatting. See also the action=raw documentation

To get more information about the page and its latest version, use the API: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Main_Page. See also the documentation for the prop=revisions module.

get the content of a page (HTML)?
If you just want the HTML, it's best to use index.php's action=render mode instead of the API: http://en.wikipedia.org/w/index.php?action=render&title=Main_Page. See also the action=render documentation.

To get more information distilled from the wikitext at parse time (links, categories, sections, etc.), use the API parse module: http://en.wikipedia.org/w/api.php?action=parse&page=Main_Page. See also the documentation for the action=parse module.