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

# You.com Tools

> Demonstrates the YouTools toolkit which exposes the You.com Search API as a first-class Agno tool.

```python youcom_tools.py theme={null}
"""
You.com Tools
=============================

Demonstrates the YouTools toolkit which exposes the You.com Search API as a
first-class Agno tool.

Set ``YDC_API_KEY`` in your environment before running this example.
Get a key at https://you.com/platform/api-keys.

No API key? You.com also hosts a free MCP profile at
``https://api.you.com/mcp?profile=free`` (``you-search`` with 100 queries/day,
no key or sign-up required). To use it, plug that URL into Agno's MCPTools
instead of YouTools.
"""

from agno.agent import Agent
from agno.tools.youcom import YouTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


# Example 1: Default search agent
agent = Agent(
    tools=[YouTools(show_results=True)],
    markdown=True,
)

# Example 2: Search with a domain allowlist and a larger result count
agent_filtered = Agent(
    tools=[
        YouTools(
            include_domains=["cnbc.com", "reuters.com", "bloomberg.com"],
            num_results=8,
            show_results=True,
        )
    ],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    agent.print_response("Search for the latest AAPL news", markdown=True)

    agent_filtered.print_response(
        "What did major financial outlets say about NVDA earnings this week?",
        markdown=True,
    )
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      export YDC_API_KEY="your_ydc_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      $Env:YDC_API_KEY="your_ydc_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `youcom_tools.py`, then run:

    ```bash theme={null}
    python youcom_tools.py
    ```
  </Step>
</Steps>

Full source: [cookbook/91\_tools/youcom\_tools.py](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/youcom_tools.py)
