duckduckgo

Duck Duck go HTML version get next page of results url query param


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?


Solution

  • 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:

    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