Tavily Extract
Extract web page content from one or more specified URLs using Tavily Extract.
Dynamic pricing
ceil(count(body.urls) / 5) * (lower(body.extract_depth) == 'advanced' ? 0.02 : 0.01)
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "tavily",
path: "/extract",
body: {
"urls": "example"
}
});
console.log(output);Body parameters
The URL to extract content from.
User intent for reranking extracted content chunks. When provided, chunks are reranked based on relevance to this query.
Chunks are short content snippets (maximum 500 characters each) pulled directly from the source. Use chunks_per_source to define the maximum number of relevant chunks returned per source and to control the raw_content length. Chunks will appear in the raw_content field as: <chunk 1> [...] <chunk 2> [...] <chunk 3>. Available only when query is provided. Must be between 1 and 5.
The depth of the extraction process. advanced extraction retrieves more data, including tables and embedded content, with higher success but may increase latency.basic extraction costs 1 credit per 5 successful URL extractions, while advanced extraction costs 2 credits per 5 successful URL extractions.
Include a list of images extracted from the URLs in the response. Default is false.
Whether to include the favicon URL for each result.
The format of the extracted web page content. markdown returns content in markdown format. text returns plain text and may increase latency.
Maximum time in seconds to wait for the URL extraction before timing out. Must be between 1.0 and 60.0 seconds. If not specified, default timeouts are applied based on extract_depth: 10 seconds for basic extraction and 30 seconds for advanced extraction.
Response