360 Secure SkillHub
360 安全技能中心

Tavily Extract

核心功能:调用Tavily API从指定URL提取干净的Markdown/文本,支持单/多URL批量提取,可通过--query聚焦相关片段,可选advanced深度处理动态JS页面,还可配置输出格式、超时等参数。典型场景:获取技术文档、网页文章的纯净内容,批量抓取指定页面信息。输入为URL(多URL逗号分隔)及可选参数,输出为整理后的内容或JSON,需提前配置Tavily API密钥。

matthew77
matthew77
热度 64.11
最近更新 2026-05-11 17:28:04
分类:效率依赖:第三方 API应用场景:摘要总结 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add liang-tavily-extract
Metadata
name
tavily-extract
description
Extract content from specific URLs using Tavily's extraction API. Returns clean markdown/text from web pages.
homepage
https://tavily.com
metadata
{"openclaw":{"emoji":"📄","requires":{"bins":["node"],"env":["TAVILY_API_KEY"]},"primaryEnv":"TAVILY_API_KEY"}}

Tavily Extract

Extract clean content from specific URLs. Ideal when you know which pages you want content from.

Authentication

Get your API key at https://tavily.com and add to your OpenClaw config:

{
  "skills": {
    "entries": {
      "tavily-extract": {
        "enabled": true,
        "apiKey": "tvly-YOUR_API_KEY_HERE"
      }
    }
  }
}

Or set in environment variable:

export TAVILY_API_KEY="tvly-YOUR_API_KEY_HERE"

Quick Start

Using the Script

node {baseDir}/scripts/extract.mjs "https://example.com/article"
node {baseDir}/scripts/extract.mjs "url1,url2,url3"
node {baseDir}/scripts/extract.mjs "url" --query "authentication API"

Examples

# Single URL
node {baseDir}/scripts/extract.mjs "https://docs.python.org/3/tutorial/classes.html"

# Multiple URLs
node {baseDir}/scripts/extract.mjs "https://example.com/page1,https://example.com/page2"

# With query focus
node {baseDir}/scripts/extract.mjs "https://example.com/docs" --query "authentication API"

# Advanced extraction for JS pages
node {baseDir}/scripts/extract.mjs "https://app.example.com" --depth advanced --timeout 60

Options

Option Description Default
--query <text> Rerank chunks by relevance -
--chunks <n> Chunks per URL (1-5, requires query) 3
--depth <mode> Extract depth: basic or advanced basic
--format <fmt> Output format: markdown or text markdown
--timeout <sec> Max wait time (1-60 seconds) varies
--json Output raw JSON false

Extract Depth

Depth When to Use
basic Simple text extraction, faster
advanced Dynamic/JS-rendered pages, tables, structured data

Tips

  • Max 20 URLs per request - batch larger lists
  • Use --query + --chunks to get only relevant content
  • Try basic first, fall back to advanced if content is missing
  • Set longer --timeout for slow pages (up to 60s)
  • Check failed_results in JSON output for URLs that couldn't be extracted