New to Claude Skills? Learn how to install them →

andrewyng on GitHub

Tavily Best Practices

Free

Integrate Tavily for efficient web data access.

Get this skill

Free · Opens the source repo

What Tavily Best Practices does

Tavily is a specialized search API designed to enhance AI applications by providing real-time access to web data. It is particularly useful for developers and designers looking to build integrations that require efficient web search, content extraction, and crawling capabilities. Tavily facilitates the creation of production-ready solutions that can be seamlessly integrated into agentic workflows, retrieval-augmented generation (RAG) systems, and autonomous agents.

The Tavily API allows users to perform a variety of operations, including web searches, content extraction from specific URLs, site-wide crawling, and URL discovery. Each method is tailored to meet different needs, whether you require quick search results or in-depth research synthesis. The API supports both synchronous and asynchronous operations, which can be beneficial for applications that need to handle multiple queries simultaneously.

With Tavily, developers can easily initialize clients in Python or JavaScript, making it accessible for a wide range of projects. The API's flexible methods, such as search(), extract(), crawl(), map(), and research(), provide the tools necessary to gather and process data effectively. This versatility makes Tavily suitable for various use cases, from academic research to competitive analysis in business contexts.

In addition to its core functionalities, Tavily includes detailed guides and references to help users optimize their queries and maximize the potential of the API. This resource-rich environment ensures that users can leverage best practices for integrating Tavily into their applications, ultimately enhancing the performance and reliability of their AI-driven solutions.

When to use it

Use Tavily when you need to build integrations that require web search, content extraction, or crawling capabilities for AI applications.

When not to use it

Tavily may not be suitable for applications that require static data or do not need real-time web access.

What you can build with it

Academic Research

Utilize Tavily's `research()` method to conduct in-depth studies on various topics, generating comprehensive reports.

Competitive Analysis

Leverage the `search()` method to gather insights on competitors by querying relevant industry keywords.

Content Aggregation

Use the `crawl()` method to extract data from entire websites, facilitating the collection of information for analysis.

How to install Tavily Best Practices

View source

1. Install with the skills CLI

npx skills add andrewyng/context-hub/tavily-best-practices --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by andrewyng

Tavily

Tavily is a search API designed for LLMs, enabling AI applications to access real-time web data.

Installation

Python:

pip install tavily-python

JavaScript:

npm install @tavily/core

See references/sdk.md for complete SDK reference.

Client Initialization

from tavily import TavilyClient

# Uses TAVILY_API_KEY env var (recommended)
client = TavilyClient()

#With project tracking (for usage organization)
client = TavilyClient(project_id="your-project-id")

# Async client for parallel queries
from tavily import AsyncTavilyClient
async_client = AsyncTavilyClient()

Choosing the Right Method

For custom agents/workflows:

NeedMethod
Web search resultssearch()
Content from specific URLsextract()
Content from entire sitecrawl()
URL discovery from sitemap()

For out-of-the-box research:

NeedMethod
End-to-end research with AI synthesisresearch()

Quick Reference

search() - Web Search

response = client.search(
    query="quantum computing breakthroughs",  # Keep under 400 chars
    max_results=10,
    search_depth="advanced"
)
print(response)

Key parameters: query, max_results, search_depth (ultra-fast/fast/basic/advanced), include_domains, exclude_domains, time_range

See references/search.md for complete search reference.

extract() - URL Content Extraction

# Simple one-step extraction
response = client.extract(
    urls=["https://docs.example.com"],
    extract_depth="advanced"
)
print(response)

Key parameters: urls (max 20), extract_depth, query, chunks_per_source (1-5)

See references/extract.md for complete extract reference.

crawl() - Site-Wide Extraction

response = client.crawl(
    url="https://docs.example.com",
    instructions="Find API documentation pages",  # Semantic focus
    extract_depth="advanced"
)
print(response)

Key parameters: url, max_depth, max_breadth, limit, instructions, chunks_per_source, select_paths, exclude_paths

See references/crawl.md for complete crawl reference.

map() - URL Discovery

response = client.map(
    url="https://docs.example.com"
)
print(response)

research() - AI-Powered Research

import time

# For comprehensive multi-topic research
result = client.research(
    input="Analyze competitive landscape for X in SMB market",
    model="pro"  # or "mini" for focused queries, "auto" when unsure
)
request_id = result["request_id"]

# Poll until completed
response = client.get_research(request_id)
while response["status"] not in ["completed", "failed"]:
    time.sleep(10)
    response = client.get_research(request_id)

print(response["content"])  # The research report

Key parameters: input, model ("mini"/"pro"/"auto"), stream, output_schema, citation_format

See references/research.md for complete research reference.

Detailed Guides

For complete parameters, response fields, patterns, and examples:

Frequently asked questions about Tavily Best Practices

Similar skills