Detalhes do pacote

n8n-nodes-duckduckgo-search

samnodehi857MIT31.0.1

Production-grade, AI Agent-ready n8n community node for DuckDuckGo search. Features enterprise reliability with adaptive backoff, circuit breaking, and intelligent rate limiting. Search the web, images, news, and videos with privacy-focused, highly reliab

n8n-community-node-package, n8n, n8n-nodes, workflow-automation

readme (leia-me)

DuckDuckGo Search Node for n8n

npm version License: MIT

A powerful and comprehensive n8n community node that seamlessly integrates DuckDuckGo search capabilities into your workflows. Search the web, find images, discover news, and explore videos - all with privacy-focused, reliable results.

✨ Features

🤖 AI Agent Integration (New in v31.0.0)

  • Agent Tool Support: Use as a tool in n8n AI Agent workflows
  • LLM-Optimized: Clean interface designed for AI agent consumption
  • Structured Output: Predictable format perfect for downstream AI processing
  • Production-Ready: Enterprise-grade reliability for agent workloads
  • Enable: Set N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true environment variable

🛡️ Advanced Reliability System (New in v31.0.0)

  • Adaptive Backoff: Automatically backs off on consecutive empty results
  • Jittered Delays: Prevents thundering herd in parallel execution
  • Circuit Breaker: Automatic failure detection and recovery
  • Retry Logic: Configurable retries with exponential backoff
  • Metrics Tracking: Monitor performance, failures, and circuit state

🔍 Complete Search Coverage

  • Web Search: Comprehensive web search with rich content extraction
  • Image Search: High-quality image discovery with metadata
  • News Search: Real-time news from diverse sources worldwide
  • Video Search: Video content discovery across multiple platforms

🚀 Advanced Capabilities

  • Smart Query Processing: Intelligent query enhancement and optimization
  • Rich Results: Complete metadata including titles, descriptions, sources, and dates
  • Multiple Formats: Support for various content types and file formats
  • Language Support: 50+ language and region combinations
  • Search Operators: Advanced search syntax (site:, intitle:, filetype:, etc.)
  • Safe Search: Configurable content filtering options

🛡️ Privacy & Performance

  • No API Keys Required: Completely free to use without registration
  • Privacy-Focused: No user tracking or data collection
  • High Performance: Optimized for speed and reliability under load
  • Error Handling: Robust error recovery and retry mechanisms
  • Rate Limiting: Intelligent protection against overuse

📦 Installation

Via npm

npm install n8n-nodes-duckduckgo-search

Via n8n Interface

  1. Go to SettingsCommunity Nodes
  2. Enter: n8n-nodes-duckduckgo-search
  3. Click Install
  4. Restart n8n if required

🚀 Quick Start

Standard Usage

  1. Add Node: Drag the DuckDuckGo Search node into your workflow
  2. Choose Operation: Select Web, Image, News, or Video search
  3. Enter Query: Type your search terms
  4. Configure Options: Set result limits, language, and filters
  5. Execute: Run your workflow and get results!

AI Agent Usage

Use DuckDuckGo Search as a tool in AI Agent workflows for intelligent, autonomous search:

  1. Enable Community Tools: Set environment variable N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
  2. Add AI Agent: Create an AI Agent node in your workflow
  3. Connect Tool: Add DuckDuckGo Search node as a tool to your agent
  4. Configure: The agent will automatically use the search tool when needed
  5. Run: Let your AI agent autonomously search and process results

The node provides clean, structured output optimized for LLM consumption with automatic handling of parallel requests and rate limits.

🔧 Usage Examples

Web Search

{
  "operation": "search",
  "query": "artificial intelligence trends 2025",
  "webSearchOptions": {
    "maxResults": 20,
    "region": "us-en", 
    "safeSearch": 1
  }
}

Sample Output:

[
  {
    "title": "AI Trends 2025: What to Expect",
    "url": "https://example.com/ai-trends-2025",
    "description": "Comprehensive overview of artificial intelligence trends...",
    "hostname": "example.com"
  }
]

Image Search

{
  "operation": "searchImages",
  "imageQuery": "sunset mountains landscape",
  "imageSearchOptions": {
    "maxResults": 15,
    "safeSearch": 1,
    "size": "large",
    "color": "color",
    "type": "photo"
  }
}

Sample Output:

[
  {
    "title": "Beautiful Mountain Sunset",
    "url": "https://example.com/mountain-sunset.jpg",
    "thumbnail": "https://example.com/thumb.jpg",
    "height": 1080,
    "width": 1920,
    "source": "Photography Site"
  }
]

News Search

{
  "operation": "searchNews",
  "newsQuery": "renewable energy breakthrough",
  "newsSearchOptions": {
    "maxResults": 10,
    "region": "us-en",
    "safeSearch": 1,
    "timePeriod": "d"
  }
}

Sample Output:

[
  {
    "title": "Major Breakthrough in Solar Energy Efficiency",
    "url": "https://news.example.com/solar-breakthrough",
    "description": "Scientists announce 40% efficiency improvement...",
    "publishedDate": "2025-06-29",
    "source": "Tech News Daily"
  }
]

Video Search

{
  "operation": "searchVideos",
  "videoQuery": "machine learning tutorial",
  "videoSearchOptions": {
    "maxResults": 12,
    "safeSearch": 1,
    "duration": "medium",
    "resolution": "high"
  }
}

Sample Output:

[
  {
    "title": "Complete Machine Learning Tutorial",
    "url": "https://video.example.com/ml-tutorial",
    "thumbnail": "https://video.example.com/thumb.jpg",
    "duration": "15:30",
    "publishedDate": "2025-06-20",
    "views": "125000",
    "source": "Educational Channel"
  }
]

⚙️ Configuration Options

Reliability Settings (New in v31.0.0)

Advanced reliability features for production workloads:

Setting Default Description
Enable Reliability true Master switch for all reliability features
Empty Result Threshold 3 Consecutive empty results before backoff
Initial Backoff 1000ms Starting backoff delay
Max Backoff 30000ms Maximum backoff delay
Min Jitter 100ms Minimum random delay
Max Jitter 500ms Maximum random delay
Failure Threshold 5 Failures before circuit opens
Circuit Reset Timeout 60000ms Time before retry after circuit opens
Max Retries 3 Maximum retry attempts
Retry Delay 1000ms Base delay between retries

Search Types

Operation Description Max Results
Web Search General web content search 1-50
Image Search Image and visual content discovery 1-50
News Search News articles and current events 1-50
Video Search Video content from various platforms 1-50

Common Parameters

Parameter Type Description Default
query string Search terms Required
maxResults number Number of results to return 10
region string Language/region code (us-en, de-de, etc.) us-en
safeSearch number Safe search level (0=off, 1=moderate, 2=strict) 1

Advanced Options

Web Search Options

  • timePeriod: Filter by time range (d, w, m, y)
  • searchOperators: Use advanced search operators
  • useSearchOperators: Enable operator parsing

Image Search Options

  • size: Image size (small, medium, large, wallpaper)
  • color: Color filter (color, monochrome, red, orange, etc.)
  • type: Image type (photo, clipart, gif, transparent)
  • layout: Image layout (square, tall, wide)

News Search Options

  • timePeriod: Time range for news (d, w, m, y)
  • sortBy: Sort order (date, relevance)

Video Search Options

  • duration: Video length (short, medium, long)
  • resolution: Video quality (high, standard)
  • publishedTime: When published (d, w, m, y)

🔍 Advanced Search Operators

Use powerful search operators to refine your results:

Operator Example Description
site: site:github.com Search within specific site
filetype: filetype:pdf Find specific file types
intitle: intitle:"machine learning" Search in page titles
inurl: inurl:tutorial Search in URLs
"exact phrase" "artificial intelligence" Exact phrase matching
-exclude python -snake Exclude specific terms
OR cat OR dog Either term

Example with operators:

{
  "query": "site:github.com filetype:md machine learning",
  "useSearchOperators": true
}

🌍 Supported Languages & Regions

The node supports 50+ language and region combinations:

  • English: us-en, uk-en, au-en, ca-en, etc.
  • Spanish: es-es, mx-es, ar-es, etc.
  • French: fr-fr, ca-fr, ch-fr
  • German: de-de, at-de, ch-de
  • And many more: ja-jp, zh-cn, ru-ru, pt-br, it-it, nl-nl, etc.

💡 Use Cases

Content Marketing

  • Research trending topics and keywords
  • Find images for blog posts and social media
  • Monitor news about your industry
  • Discover video content for inspiration

Data Analysis

  • Gather web content for analysis
  • Build datasets from search results
  • Monitor brand mentions and sentiment
  • Track competitor content strategies

Research & Development

  • Academic research and literature review
  • Technical documentation discovery
  • Industry trend analysis
  • Competitive intelligence gathering

Automation Workflows

  • Automated content curation
  • News monitoring and alerts
  • Image collection for projects
  • SEO research and optimization

🛠️ Workflow Integration

Input Parameters

All search operations accept standardized input parameters that can be:

  • Hard-coded in the node configuration
  • Passed dynamically from previous workflow steps
  • Combined with expressions and variables

Output Structure

Results are returned as structured JSON arrays with consistent formatting:

  • Standardized fields across all search types
  • Rich metadata for comprehensive analysis
  • Clean, parsed content ready for further processing

Error Handling

Robust error handling provides:

  • Descriptive error messages for troubleshooting
  • Graceful failure handling to prevent workflow breaks
  • Retry mechanisms for temporary issues
  • Input validation to catch configuration errors

📊 Performance & Limits

Advanced Reliability (v31.0.0)

  • Adaptive Backoff: Automatic delay adjustment based on response patterns
  • Circuit Breaker: Prevents cascading failures with automatic recovery
  • Jittered Delays: Randomized timing prevents thundering herd
  • Retry Logic: Exponential backoff with configurable attempts
  • Metrics Tracking: Real-time monitoring of performance and failures

Rate Limiting

  • Built-in protection against overuse
  • Intelligent delay mechanisms between requests
  • Configurable retry logic for failed requests
  • Circuit breaking for automatic failure handling

Result Limits

  • Web Search: Up to 50 results per request
  • Image Search: Up to 50 images per request
  • News Search: Up to 50 articles per request
  • Video Search: Up to 50 videos per request

Performance Tips

  • Use specific queries for better, faster results
  • Set appropriate result limits for your use case
  • Leverage caching for repeated searches
  • Use search operators to narrow results efficiently
  • Enable reliability features for production workloads
  • Monitor circuit breaker state in high-volume scenarios

🔒 Privacy & Security

Privacy-First Design

  • No user tracking or data collection
  • No API keys required - completely free
  • Direct DuckDuckGo integration without third-party services
  • Secure HTTP client configuration

Data Handling

  • Minimal data retention - results processed and returned immediately
  • No persistent storage of search queries or results
  • Clean HTTP requests without unnecessary headers or tracking

🆘 Troubleshooting

Common Issues

Empty Results

  • Check your search query for typos
  • Try broader search terms
  • Verify region/language settings
  • Ensure safe search settings are appropriate

Slow Performance

  • Reduce the number of results requested
  • Use more specific search queries
  • Check your network connection
  • Consider using search operators to narrow results

Configuration Errors

  • Verify all required parameters are provided
  • Check parameter data types and formats
  • Ensure region codes are valid
  • Validate search operator syntax

📚 API Reference

Node Properties

Required Parameters

  • operation: The search operation to perform
  • query: The search terms (varies by operation type)

Optional Parameters

  • maxResults: Number of results to return (1-50)
  • region: Language/region code
  • safeSearch: Safe search filtering level
  • Additional operation-specific options

Output Format

All operations return an array of result objects with operation-specific fields but consistent structure for easy processing in your workflows.

🤝 Support & Contributing

Getting Help

  • Documentation: This README covers most use cases
  • GitHub Issues: Report bugs or request features
  • Community: Join the n8n community for discussions

Contributing

This is an open-source project. Contributions are welcome:

  • Bug Reports: Help us improve reliability
  • Feature Requests: Suggest new capabilities
  • Code Contributions: Submit pull requests
  • Documentation: Help improve guides and examples

📄 License

MIT License - see the LICENSE file for details.


Ready to get started? Install the node and begin searching with DuckDuckGo's powerful, privacy-focused search capabilities in your n8n workflows today!

changelog (log de mudanças)

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[31.0.1] - 2025-11-11

🚨 CRITICAL FIX - Reliability System Now Functional

This is a critical patch that fixes TWO major bugs in v31.0.0 where the reliability system was completely broken.

🐛 Critical Bug Fixes:

Bug #1: Reliability Manager Not Invoked

  • FIXED: Reliability manager is now properly integrated into all search operations
  • FIXED: All HTTP requests now wrapped with executeWithRetry for retry logic
  • FIXED: Adaptive backoff, jitter, and circuit breaking now actually apply
  • FIXED: Empty result detection and consecutive failure tracking now functional
  • FIXED: Metrics tracking (response times, failures, circuit state) now works

Bug #2: Double-Counting of Metrics

  • FIXED: Removed duplicate metric recording that counted every request twice
  • FIXED: Circuit breaker now trips at exact configured threshold (not half)
  • FIXED: Adaptive backoff triggers at correct consecutive empty count
  • FIXED: All metrics (totalRequests, emptyResponses, failures) now accurate

📊 What Was Broken:

In v31.0.0:

  1. The reliabilityManager variable was initialized but never invoked - all search requests bypassed the reliability system entirely
  2. After the initial fix attempt, metrics were being counted twice (manual + executeWithRetry) - breaking all threshold logic

Result: All reliability features (backoff, jitter, retries, circuit breaking) were completely non-functional.

What's Fixed:

  • All search operations (Web, Image, News, Video) now execute through reliabilityManager.executeWithRetry()
  • Metric recording handled exclusively by executeWithRetry (no double-counting)
  • Circuit breaker trips at exact configured threshold (e.g., 10 failures = 10 counts, not 20)
  • Adaptive backoff triggers at exact consecutive empty count (e.g., 3 = 3, not 6)
  • Success and failure metrics are properly recorded once per request
  • Jittered delays apply to prevent thundering herd
  • Retry logic with exponential backoff now functions correctly

🧪 Testing:

  • Added comprehensive integration tests proving reliability manager invocation
  • CRITICAL: Added tests verifying no double-counting of metrics
  • Verified circuit breaker trips at exact configured threshold
  • Confirmed backoff activates at exact consecutive empty threshold
  • Validated retry logic works correctly
  • Tests prove: 5 requests = 5 totalRequests (not 10), 10 failures trips circuit at threshold 10 (not 5)

⚠️ Impact:

Users who installed v31.0.0 MUST immediately upgrade to v31.0.1. The reliability features advertised in v31.0.0 were completely broken until this patch.


[31.0.0] - 2025-11-11

🚀 Major Release - Agent-Ready & Production-Grade Reliability

This is a major upgrade that transforms the DuckDuckGo Search node into a production-grade, AI Agent-ready tool with enterprise-level reliability features.

New Features:

🤖 AI Agent Integration

  • Agent Tool Support: Node is now usable as an AI Agent tool in n8n workflows
  • Simplified Interface: Clean, minimal input contract optimized for LLM consumption
  • Structured Output: Predictable output format designed for agent consumption
  • Tool Description: AI-friendly parameter descriptions for better agent understanding
  • Enable via environment variable: N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

🛡️ Advanced Reliability System

  • Adaptive Backoff: Automatically backs off when consecutive empty results are detected
  • Jittered Delays: Random jitter prevents thundering herd problems in parallel execution
  • Circuit Breaker: Automatic failure detection and recovery mechanism
  • Retry Logic: Configurable retry attempts with exponential backoff
  • Operational Metrics: Real-time tracking of requests, failures, and performance

⚙️ Reliability Configuration

  • Empty Result Threshold: Configure when to trigger adaptive backoff
  • Backoff Settings: Control initial delay, maximum delay, and multiplier
  • Jitter Range: Set minimum and maximum random delays
  • Circuit Breaker: Configure failure threshold and reset timeout
  • Retry Behavior: Set maximum retries and delay between attempts

📊 Observability & Monitoring

  • Circuit state monitoring (CLOSED, OPEN, HALF_OPEN)
  • Request and response metrics tracking
  • Average response time calculation
  • Empty response rate tracking
  • Backoff activation counts
  • Circuit breaker trip events
  • Retry attempt tracking

🔧 Improvements:

Performance

  • Optimized parallel request handling
  • Reduced rate limiting issues through intelligent backoff
  • Better resource utilization with circuit breaking
  • Improved response times under load

Stability

  • Handles bursty workloads gracefully
  • Prevents cascading failures with circuit breaker
  • Automatic recovery from transient errors
  • Resilient to DuckDuckGo rate limits

Developer Experience

  • Comprehensive test suite (132 passing tests)
  • Production-ready error handling
  • Clear operational signals
  • Extensive documentation

📚 Technical Enhancements:

New Modules

  • reliabilityManager.ts: Complete reliability management system
  • Comprehensive test coverage for reliability features
  • Global reliability manager for cross-request coordination

Configuration

  • Backward compatible - all features are opt-in
  • Sensible defaults that work out of the box
  • Fine-tuning options for advanced use cases

🎯 Use Cases:

AI Agent Workflows

  • Use as a search tool in AI agent workflows
  • Reliable search results for agent decision-making
  • Structured data perfect for LLM processing

High-Volume Search

  • Handle parallel searches from multiple workflows
  • Automatic rate limit management
  • Graceful degradation under load

Production Workloads

  • Enterprise-grade reliability
  • Automatic failure recovery
  • Performance monitoring

Breaking Changes:

None - this release maintains full backward compatibility while adding new opt-in features.

🐛 Bug Fixes:

  • Improved handling of empty result scenarios
  • Better error messages for rate limiting
  • Enhanced parallel request coordination

📦 Dependencies:

No new external dependencies added - all reliability features built with native capabilities.


[30.0.4] - 2025-06-29

🎉 Initial Release - Complete DuckDuckGo Search Integration for n8n

Core Features:

🔍 Web Search

  • Advanced web search with comprehensive result parsing
  • Support for multiple result formats (title, URL, description, hostname)
  • Intelligent query enhancement for better search results
  • Clean HTML content extraction with proper text normalization

🖼️ Image Search

  • High-quality image search with thumbnail and full-size URLs
  • Rich metadata including dimensions, source, and title
  • Support for various image formats and sources
  • Efficient image result processing

📰 News Search

  • Real-time news search from diverse sources
  • Publication date and source information
  • News-specific filtering and sorting options
  • Clean news content extraction

🎥 Video Search

  • Comprehensive video search across platforms
  • Video metadata including duration, views, and publish date
  • Thumbnail extraction and video source information
  • Support for various video platforms

🛠️ Advanced Capabilities:

⚙️ Search Configuration

  • Customizable result limits (1-50 results per search)
  • Multiple language and region support
  • Safe search filtering options
  • Search operator support for advanced queries

🌐 Locale & Region Support

  • 50+ language/region combinations
  • Automatic locale detection and handling
  • Customizable regional search preferences
  • Multi-language result processing

🔧 Advanced Query Processing

  • Smart query enhancement and optimization
  • Search operator parsing (site:, intitle:, filetype:, etc.)
  • Query validation and error handling
  • Special character and encoding support

🚀 Performance & Reliability

  • Built-in rate limiting and retry mechanisms
  • Efficient HTTP client with timeout handling
  • Comprehensive error handling and recovery
  • Memory-efficient result processing

🔒 Privacy & Security

  • No API keys required - completely free to use
  • Direct DuckDuckGo integration without third-party services
  • Privacy-focused search without user tracking
  • Secure HTTP client configuration

📊 Technical Specifications:

🏗️ Architecture

  • TypeScript implementation with full type safety
  • Modular design with separate search modules
  • Comprehensive test coverage (97 tests)
  • Clean code architecture following n8n standards

🔌 Integration Features

  • Seamless n8n workflow integration
  • Input/output parameter validation
  • Error handling with descriptive messages
  • Consistent data structure across all search types

⚡ Performance

  • Optimized HTML parsing algorithms
  • Efficient memory usage
  • Fast response times
  • Minimal dependencies

🎯 Use Cases:

  • Content Research: Gather comprehensive web content for analysis
  • Image Collection: Build image databases and galleries
  • News Monitoring: Track news and updates on specific topics
  • Video Discovery: Find relevant video content across platforms
  • SEO Research: Analyze search results and content strategies
  • Market Research: Gather competitive intelligence and trends
  • Academic Research: Collect scholarly and reference materials

🚀 Getting Started:

  1. Install the node package in your n8n instance
  2. Add the DuckDuckGo Search node to your workflow
  3. Configure your search type and parameters
  4. Execute and process the results

Ready to use immediately - no setup or API keys required!


This project provides a complete, privacy-focused search solution for n8n workflows using DuckDuckGo's powerful search capabilities.