> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/extract-1.md).

# Tavily Extract

Blocks for extracting clean page content from URLs with Tavily.

## Tavily Extract

### What it is

Extracts page content from one or more URLs using Tavily, optimized for LLM consumption

### How it works

The block takes up to 20 URLs per request, fetches each page, and returns cleaned content in `markdown` or `text` format optimized for LLM consumption. Setting `extract_depth` to advanced retrieves more from each page, including tables and embedded content, at a higher credit cost.

Successfully extracted pages are returned on `results` (and one at a time on `result`), while any URLs that could not be fetched are surfaced separately on `failed_urls` — so a few bad URLs never fail the whole batch. Cost is 1 credit per 5 successfully extracted URLs (2 per 5 for advanced); failed extractions are free, and actual spend is read from the API's usage report.

### Inputs

| Input          | Description                                                                                             | Type                  | Required |
| -------------- | ------------------------------------------------------------------------------------------------------- | --------------------- | -------- |
| urls           | The URLs to extract content from (up to 20 per request)                                                 | List\[str]            | Yes      |
| extract\_depth | Depth of the extraction: basic or advanced (retrieves more data, including tables and embedded content) | "basic" \| "advanced" | No       |
| format         | The format of the extracted content                                                                     | "markdown" \| "text"  | No       |

### Outputs

| Output       | Description                            | Type                     |
| ------------ | -------------------------------------- | ------------------------ |
| error        | Error message if the extraction failed | str                      |
| results      | List of successfully extracted pages   | List\[TavilyPageContent] |
| result       | Single extracted page                  | TavilyPageContent        |
| failed\_urls | URLs that could not be extracted       | List\[str]               |

### Possible use case

**Content Ingestion**: Turn a list of article or documentation URLs into clean text for summarization or RAG indexing.

**Link Enrichment**: Follow up a search or map result by pulling the full content of the most relevant pages.

**Resilient Batch Scraping**: Extract many URLs at once and route any failures via `failed_urls` for retry without losing the successful pages.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://agpt.co/docs/integrations/block-integrations/extract-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
