> ## 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.

# Web Search

> Search the web with WebSearchTools using the DDGS meta-search library across backends like Google, Bing, DuckDuckGo, Brave, Yandex, and Yahoo.

**WebSearchTools** is a versatile toolkit that enables an Agent to search the web using multiple search backends. It uses the DDGS meta-search library which supports backends like Google, Bing, DuckDuckGo, Brave, Yandex, Yahoo, and more.

This is the recommended toolkit for general web search functionality. For DuckDuckGo-specific usage, see [DuckDuckGoTools](https://agno-v2.mintlify.site/tools/toolkits/search/duckduckgo.md).

## Prerequisites

The following example requires the `ddgs` and `openai` libraries.

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

## Example

```python theme={null}
from agno.agent import Agent
from agno.tools.websearch import WebSearchTools

# Basic usage with auto backend selection
agent = Agent(tools=[WebSearchTools()])
agent.print_response("What's happening in France?", markdown=True)

# Use a specific backend (e.g., google, bing, brave, yandex)
agent_google = Agent(
    tools=[WebSearchTools(backend="google")]
)
agent_google.print_response("Latest AI news", markdown=True)
```

## Toolkit Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `enable_search` | `bool` | `True` | Enable web search function. |
| `enable_news` | `bool` | `True` | Enable news search function. |
| `backend` | `str` | `"auto"` | The backend to use for searching. Options: `"auto"`, `"duckduckgo"`, `"google"`, `"bing"`, `"brave"`, `"yandex"`, `"yahoo"`, etc. |
| `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"`). |

## Toolkit Functions

| Function | Description |
| - | - |
| `web_search` | Search the web 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 the web. Parameters include `query` (str) for the search query and `max_results` (int, default=5) for maximum results. Returns JSON formatted news results. |

## Supported Backends

The `backend` parameter supports the following options:

| Backend | Description |
| - | - |
| `auto` | Automatically selects an available backend |
| `duckduckgo` | DuckDuckGo search engine |
| `google` | Google search engine |
| `bing` | Microsoft Bing search engine |
| `brave` | Brave Search |
| `yandex` | Yandex search engine |
| `yahoo` | Yahoo search engine |

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/websearch.py)
* [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/websearch_tools.py)


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