Skip to content

Tavily Extract API

Tavily Extract is a powerful tool for converting one or more web pages into clean, structured content. It is highly optimized for extracting relevant data for LLM context windows.

Endpoint

POST https://llm.siraya.pro/v1/tavily/extract

Request Parameters

Parameter Type Required Description
model string Yes Use tavily-extract.
urls array Yes A list of URLs to extract content from.
query string No User intent for reranking extracted content chunks.
extract_depth string No basic or advanced (default: basic).
include_images boolean No Whether to include images in the output.

Example Request

curl https://llm.siraya.pro/v1/tavily/extract \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_KEY>" \
  -d '{
    "model": "tavily-extract",
    "urls": ["https://en.wikipedia.org/wiki/Artificial_intelligence"],
    "extract_depth": "advanced"
  }'
import requests

url = "https://llm.siraya.pro/v1/tavily/extract"
headers = {"Authorization": "Bearer <API_KEY>"}
data = {
    "model": "tavily-extract",
    "urls": ["https://en.wikipedia.org/wiki/Artificial_intelligence"],
    "extract_depth": "advanced"
}

response = requests.post(url, headers=headers, json=data)
results = response.json().get("results", [])

Response Body

Returns an array of results for each URL:

{
  "results": [
    {
      "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
      "title": "Artificial intelligence - Wikipedia",
      "raw_content": "... extracted markdown text ...",
      "images": ["url1", "url2"]
    }
  ],
  "failed_urls": []
}