Skip to main content

What You’ll Learn

  • Running a basic web search and reading results
  • Filtering by recency and news sources
  • Constraining searches to specific domains
  • Aggregating results across multiple queries with async

How Does It Work?

Tavily Search returns relevant web results for a natural-language query, optimized for LLM consumption. Each result includes a title, URL, relevance score, and a content snippet. You can tune the depth/speed tradeoff, filter by topic or time range, and restrict results to specific domains.

Getting Started

Get your Tavily API key

1

Install the Tavily Python SDK

2

Run a search

3

Output

Restrict results to trusted sources with include_domains, or remove noise with exclude_domains.
You can also combine domain filters with exclusions:
See this pattern in action in the Product News Tracker tutorial.

Multi-Query Aggregation

For complex search operations, run multiple focused queries concurrently with AsyncTavilyClient and merge the results.
Breaking a broad question into 2-3 focused sub-queries often produces better results than a single long query.

Critical Knobs

  • Default: "basic"
  • "advanced" — highest relevance, reranked chunks (2 credits)
  • "fast" — lower latency, chunk format (1 credit)
  • "ultra-fast" — near-instant, summary format (0.5 credits)
  • time_range — relative filter: "day", "week", "month", "year"
  • start_date / end_date — absolute date range in YYYY-MM-DD format
  • Use one or the other, not both
  • Restrict results to specific domains or filter them out
  • Keep lists short for best results
  • Range: 1–20, default: 5
  • Higher values may return lower-quality results
For the complete parameter list, see the Search API reference.

Production Notes

  • Credits:
    • "basic", "fast", and "ultra-fast" cost 1 credit per query.
    • "advanced" costs 2 credits per query.
  • Rate limits: See Rate Limits for current thresholds.
  • Quality filtering: Use score from the response to filter low-relevance results (e.g., discard results below 0.5).
  • Async for throughput: Use AsyncTavilyClient with asyncio.gather when making multiple concurrent requests.

Next Steps

Search API Reference

Full parameter list, response schema, and interactive playground.

Search Best Practices

Query optimization, depth selection, filtering, and post-processing tips.

Python SDK Reference

Python client methods, async support, and type details.

JavaScript SDK Reference

JavaScript/TypeScript client methods and usage.