Skip to main content

Overview

Advanced web search using the Tavily API.

Basic Usage

Parameters

Function Parameters:
  • api_key (str): Your Tavily API key (required)
Tool Parameters:
  • query (str): The search query
  • search_deep (str): Search depth - ‘basic’ or ‘advanced’ (default: ‘basic’)
  • topic (str): Search category - ‘general’ or ‘news’ (default: ‘general’)
  • time_range (str): Time filter - ‘day’, ‘week’, ‘month’, ‘year’, ‘d’, ‘w’, ‘m’, ‘y’ (optional)

Result Format

Search results are returned as a list of dictionaries:

Getting an API Key

  1. Sign up at https://app.tavily.com/home
  2. Get your API key from the dashboard
  3. Use it in the tavily_search_tool function

Installation