Hi i have to make an app with the following requirement:
When the user opens the app, it displays the text from a random Wikipedia page.
(You’re free to use
There are two things I notice in your query. First, the exintro
means you only get sentences from over the first heading. Only a few articles have ten sentences before that. Second, you are getting results from all namespaces. By using grnnamespace=0
you will only get articles. So something like this might work for you:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&generator=random&exsentences=10&grnnamespace=0