Descriptions have been removed from the `action=opensearch` API due to performance concerns and lack of use cases (see {T240691}, especially T240691#5757544 for performance and T240691#5742010 for how this is (not) used by browsers).
See [[https://www.mediawiki.org/wiki/API:Opensearch#Response|API:Opensearch#Response]] for how the results used to look; the second array now holds empty strings.)
While `action=opensearch` is an endpoint meant specifically for browsers, and only end-of-life browsers with low usage seem to make use of descriptions, it seems many other clients did use this endpoint, judging from the feedback on various support channels (e.g. [[https://discourse-mediawiki.wmflabs.org/t/bug-feedback-on-the-opensearch-api/1602|1]], [[https://lists.wikimedia.org/pipermail/mediawiki-api/2019-December/004186.html|2]], [[https://stackoverflow.com/questions/59518708/no-content-from-wikipedia-api-search|3]], [[https://stackoverflow.com/questions/59524747/wikipedia-opensearch-api-no-longer-returns-summary-information|4]]).
Non-browser clients which do not need OpenSearch response format specifically can use the [[https://www.mediawiki.org/wiki/API:Prefixsearch|prefixsearch API]] (e.g. `action=query&generator=prefixsearch&gpssearch=<search term>&prop=extracts&exintro=1&explaintext=1&redirects=1` ([[https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts&generator=prefixsearch&redirects=1&converttitles=1&formatversion=2&exintro=1&explaintext=1&gpssearch=Hampi|sandbox]]) for extracts or `action=query&generator=prefixsearch&gpssearch=Hampi&prop=description&redirects=1` ([[https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=description&generator=prefixsearch&redirects=1&converttitles=1&formatversion=2&gpssearch=Hampi|sandbox]]) for Wikidata descriptions), but mostly this seems to have been used forSince many mobile apps which do cannot have anbe easy means of updaily updated for existing the logicusers, so there might be value in restoring descriptions to `action=opensearch` if there's a performant way to do it. Two options came up:
* Use Wikidata descriptions, which are stored in `page_props` so can be retrieved with a single query. This is a different type of description but arguably more suitable to a search API (the Wikimedia apps display Wikidata descriptions for search, for example).
* Wait for {T213505}, then build on it to use descriptions from the Page Content Service.
Clients which //can// update their logic should use the [[https://www.mediawiki.org/wiki/API:Prefixsearch|prefixsearch API]]:
* For descriptions, something like `action=query&generator=prefixsearch&gpssearch=<search term>&prop=extracts&exintro=1&explaintext=1&redirects=1` ([[https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts&generator=prefixsearch&redirects=1&converttitles=1&formatversion=2&exintro=1&explaintext=1&gpssearch=Hampi|sandbox]]) which will give results like
```lang=json
{
"batchcomplete": true,
"continue": {
"gpsoffset": 10,
"continue": "gpsoffset||"
},
"query": {
"pages": [
{
"pageid": 10165010,
"ns": 0,
"title": "Harry Sassounian",
"index": 7,
"extract": "Harry M. Sassounian, also known as Hampig Sassounian, is serving a life sentence for the 1982 assassination of Turkish Consul General Kemal Arıkan (or Arikan) at a street intersection in Los Angeles, California, United States. He was born in Beirut, Lebanon."
},
{
"pageid": 15432681,
"ns": 0,
"title": "Hampigny",
"index": 4,
"extract": "Hampigny is a commune in the Aube department in north-central France."
}
]
}
}
```
* For extracts, something like `action=query&generator=prefixsearch&gpssearch=Hampi&prop=description&redirects=1` ([[https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=description&generator=prefixsearch&redirects=1&converttitles=1&formatversion=2&gpssearch=Hampi|sandbox]]) which will give results like
```lang=json
{
"batchcomplete": true,
"continue": {
"gpsoffset": 10,
"continue": "gpsoffset||"
},
"query": {
"pages": [
{
"pageid": 10165010,
"ns": 0,
"title": "Harry Sassounian",
"index": 7,
"description": "American assassin",
"descriptionsource": "central"
},
{
"pageid": 15432681,
"ns": 0,
"title": "Hampigny",
"index": 4,
"description": "Commune in Grand Est, France",
"descriptionsource": "local"
}
]
}
}
```