Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Wikipedia API continue parameter

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?

like image 203
Miha Šušteršič Avatar asked Sep 27 '16 09:09

Miha Šušteršič


1 Answers

You should pass on the contents of the continue field. I.e. sroffset= 10&contiue=-||.

like image 196
Tgr Avatar answered Nov 15 '22 06:11

Tgr