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.
| Parameter | Type | Description |
|---|---|---|
qrequired | string | Required search text, up to 500 characters. |
kl | string | DuckDuckGo region and language token, such as us-en. |
safe | "1" | "-1" | "-2" | DuckDuckGo safe-search level.Default: -1. |
df | string | Date window: d, w, m, y, or YYYY-MM-DD..YYYY-MM-DD. |
Pagination
Control result count, offset, and search assistance.
| Parameter | Type | Description |
|---|---|---|
search_assist | boolean | Enable DuckDuckGo query assistance; mutually exclusive with m.Default: true. |
start | integer | Result offset from 0 through 10,000.Default: 0. |
m | integer | Requested 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())