Loading...
Loading...
Compare original and translation side by side
~/.claude/settings.json{
"env": {
"TAVILY_API_KEY": "tvly-your-api-key-here"
}
}~/.claude/settings.json{
"env": {
"TAVILY_API_KEY": "tvly-your-api-key-here"
}
}./scripts/extract.sh '<json>'undefined./scripts/extract.sh '<json>'undefinedundefinedundefinedcurl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://example.com/article"]
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://example.com/article"]
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://example.com/ml-healthcare",
"https://example.com/ai-diagnostics"
],
"query": "AI diagnostic tools accuracy",
"chunks_per_source": 3
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://example.com/ml-healthcare",
"https://example.com/ai-diagnostics"
],
"query": "AI diagnostic tools accuracy",
"chunks_per_source": 3
}'POST https://api.tavily.com/extractPOST https://api.tavily.com/extract| Header | Value |
|---|---|
| |
| |
| 请求头 | 值 |
|---|---|
| |
| |
| Field | Type | Default | Description |
|---|---|---|---|
| array | Required | URLs to extract (max 20) |
| string | null | Reranks chunks by relevance |
| integer | 3 | Chunks per URL (1-5, requires query) |
| string | | |
| string | | |
| boolean | false | Include image URLs |
| float | varies | Max wait (1-60 seconds) |
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 数组 | 必填 | 要提取的URL(最多20个) |
| 字符串 | null | 按相关性重新排序内容块 |
| 整数 | 3 | 每个URL的内容块数量(1-5,需要指定query) |
| 字符串 | | |
| 字符串 | | |
| 布尔值 | false | 是否包含图片URL |
| 浮点数 | 可变 | 最大等待时间(1-60秒) |
{
"results": [
{
"url": "https://example.com/article",
"raw_content": "# Article Title\n\nContent..."
}
],
"failed_results": [],
"response_time": 2.3
}{
"results": [
{
"url": "https://example.com/article",
"raw_content": "# Article Title\n\nContent..."
}
],
"failed_results": [],
"response_time": 2.3
}| Depth | When to Use |
|---|---|
| Simple text extraction, faster |
| Dynamic/JS-rendered pages, tables, structured data |
| 深度 | 使用场景 |
|---|---|
| 简单文本提取,速度更快 |
| 动态/JS渲染页面、表格、结构化数据 |
curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://docs.python.org/3/tutorial/classes.html"],
"extract_depth": "basic"
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://docs.python.org/3/tutorial/classes.html"],
"extract_depth": "basic"
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://example.com/react-hooks",
"https://example.com/react-state"
],
"query": "useState and useEffect patterns",
"chunks_per_source": 2
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://example.com/react-hooks",
"https://example.com/react-state"
],
"query": "useState and useEffect patterns",
"chunks_per_source": 2
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://app.example.com/dashboard"],
"extract_depth": "advanced",
"timeout": 60
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://app.example.com/dashboard"],
"extract_depth": "advanced",
"timeout": 60
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://example.com/page1",
"https://example.com/page2",
"https://example.com/page3",
"https://example.com/page4",
"https://example.com/page5"
],
"extract_depth": "basic"
}'curl --request POST \
--url https://api.tavily.com/extract \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"urls": [
"https://example.com/page1",
"https://example.com/page2",
"https://example.com/page3",
"https://example.com/page4",
"https://example.com/page5"
],
"extract_depth": "basic"
}'querychunks_per_sourcebasicadvancedtimeoutfailed_resultsquerychunks_per_sourcebasicadvancedtimeoutfailed_results