This is an auto-generated MediaWiki API documentation page.
Documentation and examples: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
format=json
(main | json)
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0-or-later
Output data in JSON format.
Parameters:
- callback
If specified, wraps the output into a given function call. For safety, all user-specific data will be restricted.
- utf8
If specified, encodes most (but not all) non-ASCII characters as UTF-8 instead of replacing them with hexadecimal escape sequences. Default when formatversion is not 1.
- Type: boolean (details)
- ascii
If specified, encodes all non-ASCII using hexadecimal escape sequences. Default when formatversion is 1.
- Type: boolean (details)
- formatversion
Output formatting
- 1
- Backwards-compatible format (XML-style booleans, * keys for content nodes, etc.).
- 2
- Modern format.
- latest
- Use the latest format (currently 2), may change without warning.
- One of the following values: 1, 2, latest
- Default: 1
Example:
- Return the query result in the JSON format.
- api.php?action=query&meta=siteinfo&siprop=namespaces&format=json [open in sandbox]