Increasing the length of the Snippets in Mediawiki API

53 Views Asked by At

I have been using the Mediawiki API for our bot, it returns the response in JSON format. The actual content of user query is the value of the "Snippet" (Snippet is the Key). The problem here is, Snippet gives only specified count of words of the actual content of our query. That is not sufficient for our app and also the content is also a half bitten result. Is there any ways to increase the length of the snippet so that we could get the actual content.

Mahendra Singh Dhoni (/məˈheɪndrə ˈsɪŋ dhæˈnɪ/ ⓘ; born 7 July 1981) is an Indian professional cricketer, who plays as a wicket-keeper-batsman. Widely regarded as one of the world's greatest wicketkeeper batsmen and captains in the history of the sport,[a] he is known for his explosive batting, wicket-keeping and leadership skills.[9] He was the captain of the Indian national team in limited-overs formats from 2007 to 2017 and in Test cricket from 2008 to 2014. He plays for and captains Chennai Super Kings franchise in the Indian Premier League.

The highlighted words are the missing words!!

1

There are 1 best solutions below

0
On

This is not possible with only the list=search query. Instead you can use the list as a generator and pair it with the extracts prop.

e.g. https://en.wikipedia.org/w/api.php?action=query&format=json&generator=search&gsrsearch=query&prop=extracts&exintro=true&explaintext=true