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

# You.com

**YouTools** enable an Agent to search the web using the You.com Search API.

## Prerequisites

YouTools uses the `httpx` client already bundled with Agno. The only requirement is a You.com API key, available at [you.com/platform/api-keys](https://you.com/platform/api-keys).

```shell theme={null}
export YDC_API_KEY=***
# optional: point at a non-default endpoint (e.g. staging)
export YDC_BASE_URL=https://api.you.com
```

No API key? You.com also hosts a free MCP profile at `https://api.you.com/mcp?profile=free` (`you-search`, 100 queries/day, no signup). Plug that URL into Agno's [MCPTools](/tools/mcp/overview) instead of YouTools.

## Example

The following agent searches You.com for AAPL news and prints the response.

```python cookbook/91_tools/youcom_tools.py theme={null}
from agno.agent import Agent
from agno.tools.youcom import YouTools

agent = Agent(
    tools=[YouTools(
        include_domains=["cnbc.com", "reuters.com", "bloomberg.com"],
        num_results=8,
        show_results=True,
    )],
)
agent.print_response("Search for AAPL news", markdown=True)
```

## Toolkit Functions

| Function     | Description                                                                                                                                                        |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `you_search` | Search the web for a given query. Accepts `query` (str) and an optional `num_results` (int) to override the configured count. Returns results as JSON or markdown. |

## Toolkit Params

| Parameter           | Type                                            | Default      | Description                                                                          |
| ------------------- | ----------------------------------------------- | ------------ | ------------------------------------------------------------------------------------ |
| `api_key`           | `Optional[str]`                                 | `None`       | You.com API key. Falls back to the `YDC_API_KEY` environment variable.               |
| `base_url`          | `Optional[str]`                                 | `None`       | Override the API base URL. Falls back to `YDC_BASE_URL`, then `https://api.you.com`. |
| `num_results`       | `int`                                           | `5`          | Default number of search results.                                                    |
| `livecrawl`         | `Literal['always', 'fallback', 'never', 'web']` | `'web'`      | Live-crawl mode for the search API.                                                  |
| `livecrawl_formats` | `str`                                           | `'markdown'` | Comma-separated content formats to request from livecrawl (e.g. `markdown`, `text`). |
| `text_length_limit` | `int`                                           | `1000`       | Maximum length of text content per result.                                           |
| `include_domains`   | `Optional[List[str]]`                           | `None`       | Restrict results to these domains.                                                   |
| `exclude_domains`   | `Optional[List[str]]`                           | `None`       | Exclude results from these domains.                                                  |
| `timeout`           | `int`                                           | `30`         | Maximum time in seconds to wait for API responses.                                   |
| `format`            | `Literal['json', 'markdown']`                   | `'json'`     | Output format for search results.                                                    |
| `show_results`      | `bool`                                          | `False`      | Log responses for debugging.                                                         |

## Developer Resources

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