Skip to main content

What You’ll Learn

  • Crawling a website and extracting clean content from its pages
  • Using path filters and instructions for selective crawling
  • When to use Crawl vs Map
  • Feeding crawled content into a retrieval pipeline

How Does It Work?

Tavily Crawl follows links from a starting URL and extracts clean content from each page it visits. Unlike Map (which only discovers URLs), Crawl returns the full page content as markdown or text, ready for LLM consumption. Rule of thumb: Use Map when you need to find pages. Use Crawl when you need to read pages.

Getting Started

Get your Tavily API key

1

Install the Tavily Python SDK

2

Crawl a website

3

Output

Documentation Ingestion

Crawl a docs site with select_paths to focus on the pages that matter, and extract_depth: "advanced" for complex pages with tables or code blocks.
Start with max_depth=1 and a conservative limit. Each level of depth increases crawl time exponentially — scale up only after verifying results.

Selective Path Crawling

Combine path patterns with natural-language instructions to focus the crawl semantically. When instructions are set, you can also use chunks_per_source to get only the most relevant snippets per page.
With chunks_per_source, the raw_content field contains the top relevant chunks separated by [...] instead of the full page, keeping context windows small.

Crawl-to-Retrieval Pipeline

Crawl a site, chunk the content, and build a searchable index. This sketch shows the pattern — for a complete implementation, see the Crawl to RAG app example.

Critical Knobs

  • Range: 1–5, default: 1
  • Each level increases crawl time exponentially
  • Start at 1 and increase only after verifying results
  • Range: 1–500, default: 20
  • Controls how many links are followed per page level
  • Hard cap on total pages crawled
  • Always set this to prevent runaway crawls and unexpected costs
  • Regex patterns to include or exclude URL paths
  • Example: "/docs/.*" to target docs, "/blog/.*" to skip blog posts
  • "basic" (default) — standard content, faster
  • "advanced" — tables, embedded content, JS-rendered pages, slower but more thorough
  • Natural-language guidance for the crawler
  • Enables semantic filtering of pages
  • Unlocks chunks_per_source for targeted content retrieval
For the complete parameter list, see the Crawl API reference.

Production Notes

  • Cost control: Always set limit to cap the number of pages. Each crawled page consumes credits based on extract_depth.
  • Timeouts: Large crawls can take time. Use the timeout parameter (10-150s) to set upper bounds.
  • Failed pages: Check response["failed_results"] for pages that couldn’t be extracted. Adjust extract_depth or path filters accordingly.
  • Map first: Consider using Map to discover the site structure before crawling. This lets you identify the right select_paths patterns and set a realistic limit.

Next Steps

Crawl API Reference

Full parameter list, response schema, and interactive playground.

Crawl Best Practices

Depth tuning, path filtering, domain controls, and common pitfalls.

Python SDK Reference

Python client methods, async support, and type details.

JavaScript SDK Reference

JavaScript/TypeScript client methods and usage.