Overview
This node performs various types of searches using the DuckDuckGo search engine, including web, image, news, and video searches. Specifically for the News Search operation, it allows users to query recent news articles based on specified search terms and filtering options.
Common scenarios where this node is beneficial include:
- Aggregating current news articles related to specific topics or keywords.
- Monitoring news trends in particular regions or languages.
- Filtering news content by time periods or safe search levels.
- Integrating news search results into automated workflows for content curation, alerts, or analysis.
For example, a user could set up a workflow that automatically fetches the latest news about "electric vehicles" from the past week in the United States with moderate content filtering, then processes or stores these articles for further use.
Properties
| Name | Meaning |
|---|---|
| Locale | Specifies the language/region locale for the search (e.g., English US, Spanish Spain, French France). |
| Use API Key | Whether to authenticate requests using an API key credential for DuckDuckGo API access. |
| News Search Query | The search terms used to find relevant news articles. This is a required string input. |
| News Search Options | Collection of options to customize the news search: • Maximum Results: Number of news articles to return (1–100). • Region: Target region for news (e.g., United States, Germany, Worldwide). • Safe Search: Content filtering level (Strict, Moderate, Off). • Time Period: Time range for news articles (All Time, Past Day, Past Week, Past Month, Past Year). • Return Raw Results: Whether to output the raw API response instead of processed results. |
| Error Handling | Defines how errors are handled during execution: • Break on Error: Stop execution when an error occurs. • Continue on Error: Proceed even if errors occur. |
| Debug Mode | When enabled, includes detailed request and response information in the output for troubleshooting purposes. |
| Cache Settings | Controls caching behavior: • Enable Cache: Whether to cache search results to improve performance. • Cache TTL: Duration in seconds to keep cached results (60–86400 seconds). |
| Enable Telemetry | Whether to send anonymous usage data to help improve the node (no personal or sensitive data is collected). |
Output
The node outputs JSON objects containing the results of the news search. The structure includes:
success: Boolean indicating if the search was successful.query: The original search query string.count: Number of news articles returned.results: An array of news article objects, each typically containing details such as title, source, URL, publication date, and snippet.- Optional fields when debug mode is enabled or raw results requested:
requestOptions: The parameters used for the search request.fromCache: Boolean indicating if the result was retrieved from cache.result: The full raw API response object if raw results are requested.
- In case of errors:
error: A message describing the error.errorDetails: Detailed error stack trace or message (if debug mode enabled).
The node does not output binary data.
Dependencies
- Requires access to the DuckDuckGo search services via the
duck-duck-scrapelibrary. - Optionally requires an API key credential if "Use API Key" is enabled.
- Supports caching internally to optimize repeated queries.
- Telemetry can be optionally enabled to send anonymous usage data.
- No additional external environment variables are explicitly required.
Troubleshooting
Common Issues
- Missing API Key: If "Use API Key" is enabled but no API key credential is provided, the node will throw an error requiring the API key.
- No Results Found: Queries may return zero results if the search terms are too specific, misspelled, or filtered out by safe search or region/time settings.
- Rate Limiting or Network Errors: External API calls might fail due to network issues or rate limits imposed by DuckDuckGo.
- Invalid Parameter Values: Providing invalid values for options like max results, region, or time period may cause errors.
Error Messages and Resolutions
"API key is required when 'Use API Key' is enabled!": Provide a valid API key credential in the node configuration."The operation \"<operation>\" is not supported!": Ensure the selected operation matches one of the supported types (Web, Image, News, Video).- Errors related to network or API failures will include parsed messages; enabling debug mode helps diagnose by showing request and response details.
- To handle errors gracefully, configure "Error Handling" to continue on error, allowing workflows to proceed despite individual failures.
Links and References
- DuckDuckGo Search Engine
- DuckDuckGo Scraper Library (duck-duck-scrape) (used internally)
- n8n Documentation on Creating Custom Nodes