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.
The API we used: https://en.wikipedia.org/w/api.phpaction=query&format=json&list=search&srsearch=query
Our Query: Dhoni
What it returns(in Snippet): 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
What actual content in Wiki is:
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!!
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