API:Search and discovery

Core MediaWiki together with extensions provide several search capabilities. The Search and Discovery team maintains and enhances them.

api.php
The MediaWiki web has several search-related modules. You can make requests and view generated help at any wiki's /w/api.php entry point, or fill in API request parameters at Special:ApiSandbox.

Search modules

 * action=opensearch
 * Generated API help


 * action=languagesearch
 * Generated API help

Query list submodules
These return a list of wiki pages matching the search criteria, plus some information. Furthermore, you can use each as a generator to provide other  Properties of the set of pages, such as a lead image, snippet, and/or page description.


 * action= list=prefixsearch
 * This merely returns wiki pages with the given prefix. See Showcase article  Page info in search results  Generated API help.


 * action=query list=search
 * See API:Search page. what is difference between opensearch with suggest and action=query&list=search ?.  Generated API help


 * action=query list=geosearch
 * See showcase article Showing nearby wiki information.  Generated API help.

Wikidata Query Service
Under development, maybe through api.php
 * currently       on labs only

Cirrus search API
maybe a dedicated Cirrus Search API.  Is this different/beyond opensearch module or list=search query submodule with srinfo=suggestions ?

Wikidata
Another axis for search results is to query the Wikidata "Q" item associated with a page. For example, the Albert Einstein article has item  "Q937" (available in JavaScript via  ;). Given the item, you can query the wikidata wiki for, e.g.  to get language-independent information about this item. Continuing this example, https://www.wikidata.org/w/api.php?action=wbgetclaims&entity=Q937

You can also query for  to get basic entity information such as the   of the concept in the local language (although this is available by querying any local wiki page for   so you don't have to issue a query to wikidata). For example, https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q937 returns the  of "German-American physicist..."