Update: Disambiguation pages are a content-type of WikiPedia (the installation), and not a page-type in MediaWiki (the software). Thus, the MediaWiki API has no knowledge of what disambiguation pages are, and has not method for retrieving them.
See this related discussion.
Other than the often-but-not-always method I layout below, you would basically have to retrieve the page body, and check for the presence of a disambiguation marker.
The below sometimes works:
When I search for SEO I get: https://en.wikipedia.org/wiki/SEO
Are you referring to disambiguation pages? like https://en.wikipedia.org/wiki/SEO_%28disambiguation%29 ?
If so, check the title for disambiguation.
for instance, the following search : https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=SEO&srwhat=text&srlimit=2
yeilds
{
"query": {
"searchinfo": {
"totalhits": 3507
},
"search": [
{
"ns": 0,
"title": "Search engine optimization",
"snippet": "Search engine optimization (<span class='searchmatch'>SEO<\/span>) is the process of improving the visibility of a website or a web page in search engine s via the \" <b>...<\/b> ",
"size": 40468,
"wordcount": 5269,
"timestamp": "2012-03-11T11:43:26Z"
},
{
"ns": 0,
"title": "SEO (disambiguation)",
"snippet": "<span class='searchmatch'>SEO<\/span> or search engine optimization, the process of improving ranking in search engine results. <span class='searchmatch'>SEO<\/span> may also refer to: <span class='searchmatch'>Seo<\/span> (surname), a <b>...<\/b> ",
"size": 955,
"wordcount": 103,
"timestamp": "2012-02-22T12:51:20Z"
}
]
},
"query-continue": {
"search": {
"sroffset": 2
}
}
}
You can play around with this @ the Wikipedia API Sandbox.