Search Engine APIsDuckDuckGo Search API
Basic API Requests
Send a DuckDuckGo Search API request and read the returned SERP response.
The DuckDuckGo Search API runs through the SERP API endpoint. Send a GET request with your API key, set engine=duckduckgo, and pass the search query in q.
Request
curl --get "https://serpapi.webscrapingapi.com/v2" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "engine=duckduckgo" \
--data-urlencode "q=pizza"Required Parameters
| Name | Description |
|---|---|
api_key | Your SERP API key. Keep it server-side. |
engine | Must be duckduckgo. |
q | Search query. URL-encode this value when it contains spaces or special characters. |
Optional Parameters
| Name | Description |
|---|---|
kl | Country and language code. |
kad | Interface language. |
kp | Safe-search level. |
df | Time range filter. |
device | Device profile. |
Response
Successful requests return metadata about the submitted search and the DuckDuckGo result payload. The exact result fields can change as DuckDuckGo updates its page, so store only the fields your workflow needs.
{
"search_parameters": {
"duckduckgo_domain": "duckduckgo.com",
"search_engine": "duckduckgo",
"duckduckgo_url": "https://duckduckgo.com/?q=pizza",
"query": "pizza"
},
"search_results": "<html>...</html>"
}For region, language, safe search, and time filters, see API Parameters.