Overview
This node integrates DuckDuckGo search capabilities into n8n workflows, allowing users to perform various types of searches including web, image, news, and video searches. It supports advanced features such as locale selection, safe search filtering, time period filtering, and the use of search operators for refined queries. The node can cache results to improve performance on repeated queries and offers telemetry options for anonymous usage data collection.
Common scenarios where this node is beneficial include:
- Automating content discovery by searching the web or specific media types.
- Gathering news articles or videos related to a topic for monitoring or analysis.
- Enhancing workflows with image search results for marketing or research purposes.
- Using advanced search operators to precisely target search results.
Practical example:
- A marketing automation workflow that fetches the latest news articles about a brand daily.
- A content curation process that collects images related to a product category.
- A monitoring system that tracks video content trends on a particular subject.
Properties
| Name | Meaning |
|---|---|
| Locale | Specify the language/region locale for the search. Options include English (US), English (UK), Spanish (Spain), French (France), German (Germany), Italian (Italy), Japanese (Japan), Russian (Russia), Chinese (China), etc. |
| Use API Key | Whether to use an API key authentication for accessing the DuckDuckGo API. |
| Error Handling | How errors should be handled during execution: "Break on Error" stops execution on error; "Continue on Error" proceeds even if errors occur. |
| Debug Mode | When enabled, includes detailed request and response information in logs for troubleshooting. |
| Cache Settings | Controls caching behavior: enable or disable caching of search results and set the cache TTL (time-to-live) in seconds (60 to 86400). |
| Enable Telemetry | Whether to send anonymous usage data to help improve the node (no personal data is collected). |
| Proxy Settings | Configure proxy usage for all requests, including proxy type (HTTP, HTTPS, SOCKS4, SOCKS5), host, port, and optional authentication credentials. |
The node also supports operation-specific properties depending on the selected search type:
Web Search:
- Search Query: The terms to search on the web.
- Maximum Results: Limit on number of results returned.
- Region: Target region for results.
- Safe Search: Content filtering level (Strict, Moderate, Off).
- Time Period: Filter results by time range (All Time, Past Day, Week, Month, Year).
- Return Raw Results: Option to return raw API response.
- Search Backend: Choose backend engine (Auto, Duck-Duck-Scrape, SearchAPI, HTML Backend, Lite Backend).
- Use Search Operators: Enable advanced search operators.
- Search Operators: Collection of operators like site, filetype, intitle, inurl, exclude words, exact phrase, OR terms, etc.
- Search Filters: Additional filters for region, language, and date ranges.
Image Search:
- Image Search Query: Terms to find images for.
- Maximum Results, Region, Safe Search, Return Raw Results similar to web search.
- Additional image-specific filters like size, color, type, layout, license (not listed in user input but present in code).
News Search:
- News Search Query: Terms to find news articles.
- Maximum Results, Region, Safe Search, Time Period, Return Raw Results.
Video Search:
- Video Search Query: Terms to find videos.
- Maximum Results, Region, Safe Search, Time Period, Video Quality, Duration, License, Return Raw Results.
Output
The node outputs JSON objects containing the search results structured according to the operation performed:
Success output includes:
success: truequery: the search query usedresultorresults: array of search result items (structure varies by operation)count: number of results (sometimes included)- Optional debug info when Debug Mode is enabled (
requestOptions,fromCache) - For raw results option, the full API response is included.
Failure output includes:
success: falseerror: error message stringquery: the search query attempted- Optional detailed error stack and request options if Debug Mode is enabled.
Result item structures differ per search type but generally include fields like:
- Web Search: title, url, description, hostname
- Image Search: title, image URL, thumbnail, source URL, height, width
- News Search: title, body, url, date, source
- Video Search: title, content URL, description, embed info, provider, published date, statistics
No binary data output is produced by this node.
Dependencies
- Requires access to DuckDuckGo search services via HTTP requests.
- Optionally requires an API key credential if "Use API Key" is enabled.
- Supports proxy configuration for network requests.
- Uses internal caching mechanisms to store search results temporarily.
- Telemetry feature sends anonymous usage data externally (can be disabled).
Troubleshooting
Common issues:
- Missing or empty search query will cause an error.
- Network connectivity problems or proxy misconfiguration may lead to request failures.
- API key required if "Use API Key" is enabled but not provided.
- Invalid search operators will cause validation errors.
- Exceeding maximum allowed results or rate limits might cause incomplete results or errors.
Error messages:
"API key is required when 'Use API Key' is enabled!"— Provide a valid API key credential."Query is required for search operation"— Ensure the search query parameter is filled.- Errors from underlying HTTP requests are parsed and logged; enabling Debug Mode helps diagnose issues.
- Fallback mechanisms exist for news and video searches if primary search fails, but fallback failure will log errors.
Resolution tips:
- Verify all required parameters are set correctly.
- Check proxy settings if used.
- Enable Debug Mode to get detailed logs.
- Use "Continue on Error" mode to allow partial processing despite errors.