API:Opensearch

Calls to the OpenSearch API return pages whose name case-insensitively match a given string. When more titles match than the given limit, those which are linked the most are returned. This API module is very fast, suitable for use in search suggestions. It is used by the Wikipedia search bar and the Wikipedia-specific search bar in Firefox.

Parameters

 * search – the search string
 * limit – maximum amount of results to return (defaults to 10)
 * namespace – namespace numbers to search (delimited by, defaults to 0)
 * suggest – do nothing if $wgEnableOpenSearchSuggest is false
 * format – see below

Formats
The opensearch API module handles formats differently. Only XML and JSON (and their formatted versions) are recognized, every other valid format parameter results in JSON. The JSON format returns an array containing the search query and an array of result titles:

The XML format returns an OpenSearch XML file with titles, URLs and short descriptions:

Error codes

 * readapidenied – You need read permission to use this module.