Tavily Python SDK
Official Python client for Tavily's AI-native search API.
About
tavily-python is the official Python SDK for Tavily, a search API built for AI agents and RAG. It wraps five endpoints — Search (basic/advanced depth with per-result relevance-scored content), Extract (page content extraction), Crawl (instruction-guided site traversal), Map (site URL maps), and Research (multi-step research tasks) — plus RAG conveniences like get_search_context() (one-call context string) and qna_search(). A keyless mode lets you try search and extract without an API key; a free account at app.tavily.com adds 1,000 monthly credits.
What it can do
- **search()**: basic/advanced depth, include_domains/exclude_domains, time ranges, topic filters, relevance-scored content per result
- **extract()**: clean content extraction from arbitrary URLs
- **crawl()**: instruction-guided site crawling (e.g. 'find all pages on the Python SDK')
- **map()**: generate a URL map of a site for downstream extraction
- **research()**: async multi-step research tasks
- **RAG helpers**: get_search_context() returns a token-bounded context string; qna_search() returns a simple answer with sources
Setup
```bash
pip install tavily-python
```
```python
from tavily import TavilyClient
# With an API key
tavily = TavilyClient(api_key="tvly-YOUR_API_KEY")
response = tavily.search("Who is Leo Messi?")
# Keyless mode: no key needed (search + extract only, rate-limited)
client = TavilyClient()
response = client.search("Who is Leo Messi?")
```
Get a key at app.tavily.com. Prefer env vars (TAVILY_API_KEY) over inlining the key.
Prerequisites
Python (3.9+ per package metadata) API key only for crawl/map/research and higher limits — keyless mode covers basic search and extract.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (verified tier, metrics-v1). Evidence: 1,422 GitHub stars (log-scaled vs catalog peers); blended with ~54,978 monthly package downloads; last push 6d ago; 0 releases/12mo; 24 open issues. Manual review: keyless mode verified in README; README license badge links wrong branch (main vs master); 1,000 free credits is docs claim. License: MIT.
★ 1,422 GitHub stars
How the trust score is built
Full methodology →- Adoption · stars/downloads, log-scaled vs peers
- 6.5/10
- Maintenance · recency, releases, issue load
- 7.2/10
- Openness · license + docs
- 10.0/10
- Manual review · sanity read + red-flag check
- 8.0/10
- · 1,422 GitHub stars (log-scaled vs catalog peers)
- · blended with ~54,978 monthly package downloads
- · last push 6d ago; 0 releases/12mo; 24 open issues
- · manual review: keyless mode verified in README; README license badge links wrong branch (main vs master); 1,000 free credits is docs claim
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.