Skip to main content

What You’ll Learn

  • Extracting clean content from one or many URLs
  • Basic vs advanced extraction depth
  • Query-focused extraction for targeted content retrieval
  • Batch extraction (up to 20 URLs in a single call)

How Does It Work?

Tavily Extract takes a URL (or list of URLs) and returns the page content as clean markdown or plain text. It handles JavaScript-rendered pages, removes boilerplate (ads, navigation, footers), and returns structured content ready for LLM consumption. Two extraction depths are available:

Getting Started

Get your Tavily API key

1

Install the Tavily Python SDK

2

Extract content from a URL

3

Output

Batch Extraction

Extract content from up to 20 URLs in a single call. Failed URLs are reported separately without blocking successful ones.

Query-Focused Extraction

When you pass a query parameter, Extract reranks the content chunks by relevance to your question. Combined with chunks_per_source, this returns only the most relevant portions of each page.
The raw_content field will contain the top 3 most relevant chunks separated by [...], rather than the full page content. This is useful for keeping LLM context windows small while maintaining relevance.

Choosing the Right Extraction Depth

  • Static HTML pages (blogs, articles, documentation)
  • When speed matters more than completeness
  • High-volume batch jobs where cost is a concern
  • Pages with straightforward content structure
  • JavaScript-rendered single-page applications
  • Pages with tables, charts, or embedded content
  • When you need the highest success rate
  • Complex pages where basic extraction misses content

Critical Knobs

  • "basic" (default) — standard HTML pages, 1 credit per 5 URLs
  • "advanced" — JS-rendered pages, tables, embedded content, 2 credits per 5 URLs
  • Pass a query to rerank content by relevance to your question
  • Pair with chunks_per_source (1–5) to return only the top snippets
  • Without query, full page content is returned
  • "markdown" (default) — preserves headings, links, and structure
  • "text" — plain text, lighter for simple pipelines
For the complete parameter list, see the Extract API reference.

Next Steps

Extract API Reference

Full parameter list, response schema, and interactive playground.

Extract Best Practices

Depth selection, two-step search-then-extract, and optimization tips.

Python SDK Reference

Python client methods, async support, and type details.

JavaScript SDK Reference

JavaScript/TypeScript client methods and usage.