I am using the wikipedia API to query for a search word, for example by making a GET
request to this URL
:
https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srprop=snippet&continue=&srsearch=Slovenia
This query returns a total of 51429 hits, but will only display the first 10 results. From reading the documentation on this topic, I gather that to get the next 10 results I should pass in the continue parameter.
The relevant parameters in the API response are here:
continue: {
sroffset: 10,
continue: "-||"
}
So I build my url in the following way:
https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srprop=snippet&continue=-||&srsearch=Slovenia
But the URL returns the same set of results.
What am I doing wrong?
You should pass on the contents of the continue
field. I.e. sroffset=
10&contiue=-||
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With