---
source_url: "https://docs.langchain.com/oss/javascript/integrations/tools/tavily_extract"
title: Tavily extract integration - Docs by LangChain
mirrored_at: 2026-08-12T01:03:40.111Z
host: docs.langchain.com
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/docs.langchain.com/oss/javascript/integrations/tools/tavily_extract"
---

> **Original source:** https://docs.langchain.com/oss/javascript/integrations/tools/tavily_extract

[Tavily](https://tavily.com/) is a search engine built specifically for AI agents (LLMs), delivering real-time, accurate, and factual results at speed. Tavily offers an [Extract](https://docs.tavily.com/documentation/api-reference/endpoint/extract) endpoint that can be used to extract the cleaned, parsed content of one or more URLs.

## Overview

### Integration details

Class

Package

[PY support](https://python.langchain.com/docs/integrations/tools/tavily_extract)

Downloads

Version

[`TavilyExtract`](https://reference.langchain.com/javascript/langchain-tavily/TavilyExtract)

[`@langchain/tavily`](https://www.npmjs.com/package/@langchain/tavily)

✅

![NPM - Downloads](https://img.shields.io/npm/dm/@langchain/tavily?style=flat-square&label=%20&)

![NPM - Version](https://img.shields.io/npm/v/@langchain/tavily?style=flat-square&label=%20&)

### Tool features

[Returns artifact](https://docs.langchain.com/oss/javascript/langchain/tools)

Native async

Return data

Pricing

❌

✅

raw content and images

1,000 free credits / month

## Setup

The integration lives in the `@langchain/tavily` package, which you can install as shown below:

### Credentials

[Set up a Tavily API key](https://app.tavily.com/) and set it as an environment variable named `TAVILY_API_KEY`.

It’s also helpful (but not needed) to set up [LangSmith](https://smith.langchain.com/?utm_source=docs&utm_medium=cta&utm_campaign=langsmith-signup&utm_content=oss-javascript-integrations-tools-tavily_extract) for best-in-class observability:

## Instantiation

The tool accepts the following parameters during instantiation:

-   `extractDepth` (optional, string): Depth of the extraction, either `"basic"` or `"advanced"`. Default is `"basic"`.
-   `includeImages` (optional, boolean): Whether to include images in the extraction. Default is `false`.
-   `format` (optional, string): Content format. `"markdown"` or `"text"`. Default is `"markdown"`.
-   `includeFavicon` (optional, boolean): Include each result’s favicon URL. Default is `false`.

For a comprehensive overview of the available parameters, refer to the [Tavily Extract API documentation](https://docs.tavily.com/documentation/api-reference/endpoint/extract).

## Invocation

### [Invoke directly with args](https://docs.langchain.com/oss/javascript/langchain/tools)

The Tavily extract tool accepts the following arguments during invocation:

-   `urls` (required): A list of URLs to extract content from.
-   The following arguments can also be set during invocation: `extractDepth`, `includeImages`.

NOTE: The optional arguments are available for agents to dynamically set. If you set an argument during instantiation and then invoke the tool with a different value, the tool will use the value you passed during invocation.

### [Invoke with ToolCall](https://docs.langchain.com/oss/javascript/langchain/tools)

We can also invoke the tool with a model-generated `ToolCall`, in which case a [`ToolMessage`](https://reference.langchain.com/javascript/langchain-core/messages/ToolMessage) will be returned:

## Use within an agent

We can use the extract tool directly with a LangChain agent by passing it to `createAgent`. The agent can dynamically set the list of URLs and toggles like `extractDepth` and `includeImages` as part of its tool call.

* * *

## API reference

For detailed documentation of all Tavily Extract API features and configurations head to the API reference: [docs.tavily.com/documentation/api-reference/endpoint/extract](https://docs.tavily.com/documentation/api-reference/endpoint/extract)

* * *