Overview
This node enables performing various types of searches using the DuckDuckGo search engine, including web, image, news, and video searches. It is useful for automating information retrieval workflows where you want to gather search results programmatically without manual browsing.
Common scenarios include:
- Automatically fetching recent news articles on a topic.
- Gathering images related to a keyword for content creation.
- Searching videos for media monitoring or research.
- General web search automation for data enrichment or analysis.
For example, you could use this node to search for the latest news about a company, retrieve images for a marketing campaign, or collect video links related to a product launch.
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), and others. |
| Use API Key | Whether to authenticate requests with an API key credential for DuckDuckGo API access. |
| Search Query | The search terms to look for on the web (used in Web Search operation). |
| Web Search Options | Collection of options for web search: • Maximum Results (1-100) • Region (various country codes like us-en, uk-en, br-pt, etc.) • Safe Search level (Strict, Moderate, Off) • Time Period (All Time, Past Day, Week, Month, Year) • Return Raw Results (boolean) |
| Image Search Query | The search terms to find images for (used in Image Search operation). |
| Image Search Options | Similar to Web Search Options but for image search, including max results, region, safe search, and raw results toggle. |
| News Search Query | The search terms to find news articles for (used in News Search operation). |
| News Search Options | Similar to Web Search Options but tailored for news, including max results, region, safe search, time period, and raw results toggle. |
| Video Search Query | The search terms to find videos for (used in Video Search operation). |
| Video Search Options | Similar to Web Search Options but for video search, including max results, region, safe search, and raw results toggle. |
| Error Handling | How errors should be handled during execution: • Break on Error (stop execution) • Continue on Error (proceed despite errors) |
| Debug Mode | When enabled, includes detailed request and response logs for troubleshooting purposes. |
| Cache Settings | Controls caching behavior: • Enable Cache (boolean) • Cache TTL (time-to-live in seconds, between 60 and 86400) |
| Enable Telemetry | Whether to send anonymous usage data to help improve the node (no personal data collected). |
Output
The node outputs JSON objects containing the search results. The structure varies slightly depending on the operation:
Success output includes:
success: truequery: the original search query stringcount: number of results returnedresults: array of processed search result items (websites, images, news articles, or videos)- Optionally, if debug mode is enabled or raw results requested:
result: the full raw API response objectrequestOptions: the parameters used for the searchfromCache: boolean indicating if results were retrieved from cache
Failure output includes:
success: falseerror: error message string- Optionally, detailed error stack and request options if debug mode is enabled
The node does not output binary data; all results are JSON structured.
Dependencies
- Uses the external
duck-duck-scrapelibrary to perform the actual DuckDuckGo searches. - Optionally requires an API key credential if "Use API Key" is enabled.
- Supports caching internally to improve performance for repeated queries.
- Telemetry can be enabled to send anonymous usage data for node improvement.
No special environment variables are required beyond standard n8n credential setup for the API key if used.
Troubleshooting
- Missing API Key Error: If "Use API Key" is enabled but no API key credential is provided, the node throws an error requiring the API key.
- No Results Found: If the search returns no results, the node outputs success with zero count and empty results array.
- API Errors: Network issues, invalid queries, or rate limits may cause errors. These are caught and reported in the output with error messages.
- Cache Issues: If caching is enabled but stale or incorrect data appears, try disabling cache or adjusting TTL.
- Debug Mode: Enable debug mode to get detailed logs of requests and responses which helps diagnose issues.
- Error Handling Setting: Choose "Continue on Error" to prevent workflow interruption on failures, useful for batch processing multiple queries.
Links and References
- DuckDuckGo Official Site
- duck-duck-scrape GitHub Repository (library used internally)
- n8n Documentation on Creating Custom Nodes