Is it possible to get the next page of results for a duck duck go search on the html version using a url query param?
I found that with the right parameters, it is possible to get different pages from the /html/
version of duckduckgo.com.
You need to specify:
q
for the searchs
for the offset of the current page (nothing for the first page)dc
for the offset of the current page + 1 (start of the new page, nothing for the first page)v
to the arbitrary value l
o
to the format json
api
to the endpoint /d.js
Which gives, given the search $term
and the page $n
:
https://duckduckgo.com/html/?q=$term&s=$(($n*30))&dc=$(($n*30+1))&v=l&o=json&api=/d.js
And for the first page:
https://duckduckgo.com/html/?q=$term&s=&dc=&v=l&o=json&api=/d.js
Note 1: This can be used with both GET and POST HTML methods.
Note 2: According to my tests, it appears that the s
and dc
parameters need to respectively be a multiple of 30, and a multiple of 30, plus 1.
HTH