Overview
DuckDuckGo is a privacy-focused search engine. This tool provides web search, news, and image search capabilities without requiring an API key. The user asks a question; the agent searches DuckDuckGo and returns relevant results.Installation
Quick Start
Usage with Agent
Available Methods
search(query, max_results=5)
Search the web.news(query, max_results=5)
Get news articles.images(query, max_results=5)
Search for images.Configuration Options
Function-Based Usage
CLI Usage
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
duckduckgo-search not installed | Missing dependency | Run pip install duckduckgo-search |
RatelimitException | Too many requests | Add delay between requests or use proxy |
TimeoutException | Request timeout | Increase timeout or check network |
Advantages
- No API key required - Works out of the box
- Privacy-focused - No tracking
- Multiple search types - Web, news, images
- Free - No usage limits (respect rate limits)
How It Works
Best Practices
No API key needed
No API key needed
DuckDuckGo works without credentials — ideal for quick prototypes and privacy-sensitive use.
Cap result count
Cap result count
Request a small number of results so the agent processes fewer tokens and answers faster.
Fall back on failure
Fall back on failure
Wrap the search in error handling so the agent can switch to another search tool if a request fails.
Related Tools
Tavily
AI-powered search
Exa
Neural search engine
Serper
Google search API

