A documentação da API está disponível em inglês.

DuckDuckGo Search

Get DuckDuckGo web search results.

GET/api/v1/duckduckgo/search

Costs 1 credit per request; failed requests are refunded. Authentication, the search_metadata envelope and error codes are the same as for every endpoint (see the API reference). Try it in the playground.

Parameters

Search query

Search DuckDuckGo.

ParameterTypeDescription
qrequiredstringRequired search text, up to 500 characters.
klstringDuckDuckGo region and language token, such as us-en.
safe"1" | "-1" | "-2"DuckDuckGo safe-search level.Default: -1.
dfstringDate window: d, w, m, y, or YYYY-MM-DD..YYYY-MM-DD.

Pagination

Control result count, offset, and search assistance.

ParameterTypeDescription
search_assistbooleanEnable DuckDuckGo query assistance; mutually exclusive with m.Default: true.
startintegerResult offset from 0 through 10,000.Default: 0.
mintegerRequested result count from 1 through 50; mutually exclusive with search_assist.Default: 50.

Response

A JSON object with search_metadata (request id, credits used and remaining) and the result data: organic_results. Groups and fields depend on the content of each page, so treat every field as optional.

Examples

cURL
curl "https://serpfast.com/api/v1/duckduckgo/search?q=python+documentation" \
  -H "Authorization: Bearer $SERPFAST_KEY"
Node.js 18+
const params = new URLSearchParams({
  "q": "python documentation"
});
const res = await fetch(`https://serpfast.com/api/v1/duckduckgo/search?${params}`, {
  headers: { Authorization: `Bearer ${process.env.SERPFAST_KEY}` },
});
const data = await res.json();
console.log(data);
Python
import os, requests

params = {
  "q": "python documentation"
}
res = requests.get(
    "https://serpfast.com/api/v1/duckduckgo/search",
    params=params,
    headers={"Authorization": f"Bearer {os.environ['SERPFAST_KEY']}"},
    timeout=120,
)
print(res.json())