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 is useful for automating information retrieval tasks such as gathering current news articles, finding relevant images or videos, or conducting general web research without relying on traditional search engine APIs.
Typical use cases include:
- Automatically fetching the latest news on a topic for monitoring or reporting.
- Retrieving images or videos related to specific keywords for content creation.
- Conducting web searches to gather data or verify information within automated workflows.
The node supports caching to improve performance on repeated queries, optional API key authentication, debug mode for troubleshooting, and telemetry for anonymous usage data collection.
Properties
| Name | Meaning |
|---|---|
| Locale | Specify the language/region locale for the search results. Options include English (US), English (UK), Spanish (Spain), French (France), German (Germany), Italian (Italy), Japanese (Japan), Russian (Russia), Chinese (China), Portuguese (Brazil), Dutch (Netherlands), Polish (Poland), Swedish (Sweden), Korean (Korea), Turkish (Turkey), Arabic (Saudi Arabia), Hebrew (Israel), Persian (Iran). Default is "English (US)". |
| Use API Key | Boolean flag to enable API key authentication for accessing the DuckDuckGo API. If enabled, an API key credential must be provided. |
| Error Handling | Defines how errors are handled during execution: - Break on Error: Stop execution when an error occurs. - Continue on Error: Continue execution even if errors occur. Default is Continue on Error. |
| Debug Mode | When enabled, detailed request and response information is logged to assist with troubleshooting. |
| Cache Settings | Collection of cache-related options: - Enable Cache: Whether to cache search results to improve performance for repeated queries. - Cache TTL: Time in seconds to keep cached results (between 60 and 86400 seconds). Default TTL is 300 seconds. |
| Enable Telemetry | Boolean flag to send anonymous usage data to help improve the node. No personal data is collected. |
Additional properties depend on the selected operation (web, image, news, or video search):
- Operation: Type of search to perform (Web Search, Image Search, News Search, Video Search).
- Search Query: The search terms for the selected operation.
- Search Options: For each operation, options include maximum results (1-100), region (various supported regions), safe search level (Strict, Moderate, Off), time period (for web and news searches), and whether to return raw API results.
Output
The node outputs JSON objects containing the search results structured as follows:
success: Boolean indicating if the search was successful.query: The original search query string.count: Number of results returned (0 if none).results: An array of processed search results relevant to the operation type (web pages, images, news articles, or videos).result: The raw API response object (included if "Return Raw Results" is enabled or debug mode is active).fromCache: Boolean indicating if the result was retrieved from cache.error: Present only if the search failed, contains an error message.- Additional debug fields may include request options and error details when debug mode is enabled.
The output is paired with the input item index to maintain data consistency in workflows.
The node does not output binary data.
Dependencies
- Uses the external
duck-duck-scrapelibrary to perform DuckDuckGo searches. - Optionally requires an API key credential if "Use API Key" is enabled.
- Caching is implemented internally; no external cache service is required.
- Telemetry events are sent anonymously to improve the node but do not collect personal data.
Troubleshooting
- Missing API Key: If "Use API Key" is enabled but no API key is provided, the node throws an error requiring the API key.
- No Results Found: The node returns success with zero results if no matches are found for the query.
- Network or API Errors: Errors during search requests are caught and reported. Enabling debug mode provides detailed logs to diagnose issues.
- Cache Issues: If caching is enabled but results seem outdated, adjust the Cache TTL or disable caching.
- Unsupported Operation: If an unsupported operation is selected, the node throws an error indicating the operation is not supported.
- Error Handling Setting: If set to "Break on Error," the node stops execution on any error; otherwise, it continues and outputs error details per item.
Links and References
- DuckDuckGo Scraper Library (used internally by the node)
- DuckDuckGo Official Website
- n8n Documentation on Creating Custom Nodes