> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DuckDuckGo

> Search the web with DuckDuckGoTools, a convenience wrapper around WebSearchTools defaulting to the DuckDuckGo backend.

**DuckDuckGoTools** is a convenience wrapper around [WebSearchTools](https://agno-v2.mintlify.site/tools/toolkits/search/websearch.md) with the backend defaulting to DuckDuckGo. It enables an Agent to search the web for information using the DuckDuckGo search engine.

> [!NOTE]
>
> For more flexibility with multiple search backends (Google, Bing, Brave, Yandex, etc.), use [WebSearchTools](https://agno-v2.mintlify.site/tools/toolkits/search/websearch.md) directly.

## Prerequisites

The following example requires the `ddgs` and `openai` libraries. To install them, run the following command:

```shell theme={null}
uv pip install -U ddgs openai
```

## Example

```python theme={null}
from agno.agent import Agent
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(tools=[DuckDuckGoTools()])
agent.print_response("Whats happening in France?", markdown=True)
```

## Toolkit Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `enable_search` | `bool` | `True` | Enable DuckDuckGo search function. |
| `enable_news` | `bool` | `True` | Enable DuckDuckGo news function. |
| `modifier` | `Optional[str]` | `None` | A modifier to prepend to search queries. |
| `fixed_max_results` | `Optional[int]` | `None` | A fixed number of maximum results. |
| `proxy` | `Optional[str]` | `None` | Proxy to use for requests. |
| `timeout` | `Optional[int]` | `10` | Maximum seconds to wait for a response. |
| `verify_ssl` | `bool` | `True` | Whether to verify SSL certificates. |
| `timelimit` | `Optional[str]` | `None` | Time limit for results. `"d"` (day), `"w"` (week), `"m"` (month), `"y"` (year). |
| `region` | `Optional[str]` | `None` | Region for results (e.g., `"us-en"`, `"uk-en"`, `"ru-ru"`). |
| `backend` | `Optional[str]` | `"duckduckgo"` | Backend identifier to use for searching. This toolkit always uses the `duckduckgo` backend. |

## Toolkit Functions

| Function | Description |
| - | - |
| `web_search` | Search DuckDuckGo for a query. Parameters include `query` (str) for the search query and `max_results` (int, default=5) for maximum results. Returns JSON formatted search results. |
| `search_news` | Get the latest news from DuckDuckGo. Parameters include `query` (str) for the search query and `max_results` (int, default=5) for maximum results. Returns JSON formatted news results. |

> [!NOTE]
>
> For backward compatibility, the aliases `duckduckgo_search` and `duckduckgo_news` are also available.

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/duckduckgo.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.