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

# Tavily Tools - Advanced Search Parameters

> Scope Tavily web search by domain, recency, topic, and country.

```python tavily_tools_advanced.py theme={null}
"""
Tavily Tools - Advanced Search Parameters
=============================

Demonstrates scoping Tavily web search with the advanced parameters:
domain restriction, recency, topic, and country localization.
"""

from agno.agent import Agent
from agno.tools.tavily import TavilyTools

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


# Domain-restricted research, limited to the last month, US-localized
research_agent = Agent(
    tools=[
        TavilyTools(
            include_domains=[
                "arxiv.org",
                "github.com",
            ],  # restrict results to these domains
            exclude_domains=["reddit.com"],  # drop results from these domains
            time_range="month",  # only results from the last month
            country="united states",  # boost results from this country
        )
    ],
    markdown=True,
)

# Recent news from the last few days (days applies to the news topic only)
news_agent = Agent(
    tools=[
        TavilyTools(
            topic="news",  # general, news, or finance
            days=3,  # only news from the last 3 days
        )
    ],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    research_agent.print_response(
        "Find recent papers on mixture-of-experts language models"
    )

    news_agent.print_response("What are the latest developments in AI?")
```

## Run the Example

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

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

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

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

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

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

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