JustSERPDocs
DuckDuckGo

DuckDuckGo Search

One page (10) of DuckDuckGo's web results for a query, answered as the document: `search_metadata`, `search_parameters`, `search_information` (`query_displayed`), `organic_results`, `ads` and `pagination`.

GET
/v1/duckduckgo/search

One page (10) of DuckDuckGo's web results for a query, answered as the document: search_metadata, search_parameters, search_information (query_displayed), organic_results, ads and pagination. Not answered: ai_overview, knowledge_graph, top_stories, inline_images, inline_videos, related_searches, sitelinks. zero_retention is not handled.

Authorization

headerX-API-Key<token>

Your API key.

Query Parameters

cancel_token?string

A name you make up for this request (a UUID is fine), so you can later GET /v1/cancel with it. Only you know it, so only you can cancel. Use a new one for every request, retries included: a cancelled token stays cancelled for a few minutes.

Length1 <= length <= 128
q*string

What to search for.

Length1 <= length <= 500
device?"desktop"

Anything but desktop is a 400.

Default"desktop"
Value in"desktop"
locale?string

region-language from DuckDuckGo's list (us-en, de-de, uk-en, wt-wt for none): kl.

time_period?string

any_time, past_day, past_week, past_month, past_year, or a range YYYY-MM-DD..YYYY-MM-DD (df).

Default"any_time"
safe?string

kp=1, -1, -2; the effect was not measured.

Default"on"
Value in"on""moderate""off"
next_page_token?string

The previous answer's pagination.next_page_token.

Response Body

The results page, as the document. When the page could not be parsed, the usual envelope.

application/json
  1. response

The DuckDuckGo Search document.

search_metadata*
search_parameters*

The request's own fields as sent, engine first, without cancel_token.

search_information*

The parser's own, e.g. yelp_search's; otherwise {}.

organic_results?array<>
ads?array<>

Read from the result--ad class; none seen.

pagination?
[key: string]?any
Example Request
curl -X GET 'https://api.justserp.com/v1/duckduckgo/search?q=python+tutorial&time_period=past_week'
Example Response
{  "search_metadata": {    "id": "string",    "status": "Success",    "created_at": "string",    "request_url": "string",    "html_url": "string"  },  "search_parameters": {},  "search_information": {    "query_displayed": "string"  },  "organic_results": [    {      "position": 0,      "title": "string",      "link": "string",      "source": "string",      "displayed_link": "string",      "snippet": "string",      "snippet_highlighted_words": [        "string"      ],      "favicon": "string"    }  ],  "ads": [    {}  ],  "pagination": {    "next_page_token": "string"  }}