返回顶部
e

extractURL内容提取

Extract content from specific URLs using Tavily's extraction API. Returns clean markdown/text from web pages. Use when you have specific URLs and need their content without writing code.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
332
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

extract

提取技能

从特定URL中提取干净内容。当您明确知道需要从哪些页面获取内容时,此功能最为理想。

身份验证

该脚本通过Tavily MCP服务器使用OAuth进行身份验证。无需手动设置——首次运行时,它将:

  1. 1. 检查~/.mcp-auth/中是否存在现有令牌
  2. 如果未找到,将自动打开浏览器进行OAuth身份验证

注意: 您必须拥有现有的Tavily账户。OAuth流程仅支持登录——无法通过此流程创建账户。如果您没有账户,请先在tavily.com注册。

替代方案:API密钥

如果您更倾向于使用API密钥,请前往https://tavily.com获取密钥,并将其添加到~/.claude/settings.json:
json
{
env: {
TAVILYAPIKEY: tvly-在此处输入您的API密钥
}
}

快速开始

使用脚本

bash
./scripts/extract.sh

示例:
bash

单个URL


./scripts/extract.sh {urls: [https://example.com/article]}

多个URL

./scripts/extract.sh {urls: [https://example.com/page1, https://example.com/page2]}

带查询焦点和分块

./scripts/extract.sh {urls: [https://example.com/docs], query: authentication API, chunkspersource: 3}

针对JS页面的高级提取

./scripts/extract.sh {urls: [https://app.example.com], extract_depth: advanced, timeout: 60}

基础提取

bash
curl --request POST \
--url https://api.tavily.com/extract \
--header Authorization: Bearer $TAVILYAPIKEY \
--header Content-Type: application/json \
--data {
urls: [https://example.com/article]
}

带查询焦点的多个URL

bash
curl --request POST \
--url https://api.tavily.com/extract \
--header Authorization: Bearer $TAVILYAPIKEY \
--header Content-Type: application/json \
--data {
urls: [
https://example.com/ml-healthcare,
https://example.com/ai-diagnostics
],
query: AI diagnostic tools accuracy,
chunkspersource: 3
}

API参考

端点

POST https://api.tavily.com/extract

请求头

请求头
AuthorizationBearer <TAVILYAPIKEY>
Content-Type
application/json |

请求体

字段类型默认值描述
urls数组必填要提取的URL(最多20个)
query
字符串 | null | 按相关性重新排序内容块 | | chunkspersource | 整数 | 3 | 每个URL的内容块数(1-5,需要query参数) | | extract_depth | 字符串 | basic | basic或advanced(用于JS页面) | | format | 字符串 | markdown | markdown或text | | include_images | 布尔值 | false | 包含图片URL | | timeout | 浮点数 | 视情况而定 | 最大等待时间(1-60秒) |

响应格式

json
{
results: [
{
url: https://example.com/article,
raw_content: # 文章标题\n\n内容...
}
],
failed_results: [],
response_time: 2.3
}

提取深度

深度使用场景
basic简单文本提取,速度更快
advanced
动态/JS渲染页面、表格、结构化数据 |

示例

单个URL提取

bash
curl --request POST \
--url https://api.tavily.com/extract \
--header Authorization: Bearer $TAVILYAPIKEY \
--header Content-Type: application/json \
--data {
urls: [https://docs.python.org/3/tutorial/classes.html],
extract_depth: basic
}

带查询的定向提取

bash
curl --request POST \
--url https://api.tavily.com/extract \
--header Authorization: Bearer $TAVILYAPIKEY \
--header Content-Type: application/json \
--data {
urls: [
https://example.com/react-hooks,
https://example.com/react-state
],
query: useState and useEffect patterns,
chunkspersource: 2
}

JavaScript密集型页面

bash
curl --request POST \
--url https://api.tavily.com/extract \
--header Authorization: Bearer $TAVILYAPIKEY \
--header Content-Type: application/json \
--data {
urls: [https://app.example.com/dashboard],
extract_depth: advanced,
timeout: 60
}

批量提取

bash
curl --request POST \
--url https://api.tavily.com/extract \
--header Authorization: Bearer $TAVILYAPIKEY \
--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
}

提示

  • - 每次请求最多20个URL - 对更大的列表进行分批处理
  • 使用query + chunkspersource 仅获取相关内容
  • 先尝试basic,如果内容缺失则回退到advanced
  • 为慢速页面设置更长的timeout(最长60秒)
  • 检查failed_results 查看无法提取的URL

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 tavily-extract-1776163391 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 tavily-extract-1776163391 技能

通过命令行安装

skillhub install tavily-extract-1776163391

下载

⬇ 下载 extract v1.0.0(免费)

文件大小: 4.49 KB | 发布时间: 2026-4-15 13:00

v1.0.0 最新 2026-4-15 13:00
Initial release of the extract skill for Tavily's extraction API.

- Extracts clean markdown or text from up to 20 URLs per request.
- Supports both OAuth authentication (automatic browser flow) and API key for flexible setup.
- Offers options for targeted extraction using query and chunking, as well as depth selection for dynamic/JavaScript-heavy pages.
- Provides example usage with both shell scripts and direct curl commands.
- Response includes extracted content, failed URLs, and response time for full transparency.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部