mdgs-tavily-search-skill
使用 Tavily API 进行网络搜索、网页内容提取、抓取、映射和研究。当用户需要搜索信息、获取网页内容、从网站抓取数据、绘制网站地图或进行深度研究时使用此技能。AI 应根据任务自动选择最合适的模式。
Best use case
mdgs-tavily-search-skill is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
使用 Tavily API 进行网络搜索、网页内容提取、抓取、映射和研究。当用户需要搜索信息、获取网页内容、从网站抓取数据、绘制网站地图或进行深度研究时使用此技能。AI 应根据任务自动选择最合适的模式。
Teams using mdgs-tavily-search-skill should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mdgs-tavily-search-skill/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How mdgs-tavily-search-skill Compares
| Feature / Agent | mdgs-tavily-search-skill | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
使用 Tavily API 进行网络搜索、网页内容提取、抓取、映射和研究。当用户需要搜索信息、获取网页内容、从网站抓取数据、绘制网站地图或进行深度研究时使用此技能。AI 应根据任务自动选择最合适的模式。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Mdgs Tavily Search Skill
使用 Tavily API 进行网络搜索和信息提取。
## 快速开始
### 前置要求
首先安装依赖:
```bash
npm install @tavily/core
```
设置 API Key:
```bash
export TAVILY_API_KEY="tvly-your-api-key"
```
### 初始化客户端
```javascript
const { tavily } = require("@tavily/core");
const apiKey = process.env.TAVILY_API_KEY;
if (!apiKey) {
throw new Error("请配置 TAVILY_API_KEY 环境变量。访问 https://tavily.com 获取 API Key");
}
const tvly = tavily({ apiKey });
```
## 模式选择指南
AI 应根据任务类型自动选择合适的模式:
| 任务类型 | 推荐模式 | 说明 |
|---------|---------|------|
| 快速问答、信息检索 | search | 获取搜索结果和答案 |
| 获取特定网页内容 | extract | 提取单个 URL 的主要内容 |
| 批量抓取网站内容 | crawl | 抓取整个网站或多个页面 |
| 了解网站结构 | map | 获取网站的页面地图 |
| 深度研究主题 | research | 综合多个来源的深度研究 |
## 模式详解
### 1. 搜索网页 (search)
适用于:快速问答、信息检索、新闻搜索
```javascript
const response = await tvly.search("Who is Leo Messi?");
console.log(response);
```
**选项:**
```javascript
const response = await tvly.search("Python 教程", {
searchDepth: "basic", // "basic" 或 "advanced"
maxResults: 10,
includeAnswer: true,
includeRawContent: false,
includeImages: false
});
```
### 2. 提取网页 (extract)
适用于:获取特定网页的详细内容
```javascript
const response = await tvly.extract("https://en.wikipedia.org/wiki/Artificial_intelligence");
console.log(response);
```
**选项:**
```javascript
const response = await tvly.extract("https://example.com", {
includeImages: true
});
```
### 3. 抓取网页 (crawl)
适用于:批量抓取网站内容、深度内容获取
```javascript
const response = await tvly.crawl("https://docs.tavily.com", {
instructions: "Find all pages on the Python SDK"
});
console.log(response);
```
**选项:**
```javascript
const response = await tvly.crawl("https://example.com", {
instructions: "提取所有产品页面",
maxDepth: 2,
maxPages: 10
});
```
### 4. 绘制网页映射 (map)
适用于:了解网站结构、发现相关页面
```javascript
const response = await tvly.map("https://docs.tavily.com");
console.log(response);
```
**选项:**
```javascript
const response = await tvly.map("https://example.com", {
depth: 2,
maxPages: 20
});
```
### 5. 创建研究任务 (research)
适用于:深度研究、综合多来源分析
```javascript
const response = await tvly.research("What are the latest developments in AI?");
console.log(response);
```
**选项:**
```javascript
const response = await tvly.research("最新 AI 发展动态", {
depth: "extensive", // "basic" 或 "extensive"
maxSources: 10
});
```
## 使用脚本
项目提供了封装好的脚本:
### 搜索
```bash
node scripts/tavily.js search "搜索内容" [--depth basic|advanced] [--max-results N]
```
### 提取
```bash
node scripts/tavily.js extract "https://example.com"
```
### 抓取
```bash
node scripts/tavily.js crawl "https://example.com" --instructions "提取所有页面"
```
### 映射
```bash
node scripts/tavily.js map "https://example.com" [--depth N]
```
### 研究
```bash
node scripts/tavily.js research "研究主题" [--depth basic|extensive]
```
## API Key 配置
**重要:** 使用此技能前必须配置 API Key。
1. 访问 [tavily.com](https://tavily.com) 注册账号
2. 获取 API Key
3. 设置环境变量:
```bash
export TAVILY_API_KEY="tvly-your-actual-api-key"
```
或在脚本/代码中直接传入:
```javascript
const tvly = tavily({ apiKey: "tvly-your-actual-api-key" });
```
## 响应格式
### search response
```json
{
"answer": "回答文本",
"results": [{ "title": "", "url": "", "content": "", "score": 0.95 }],
"images": []
}
```
### extract response
```json
{
"results": [{ "url": "", "content": "", "raw_content": "" }]
}
```
### crawl response
```json
{
"results": [{ "url": "", "content": "" }]
}
```
### map response
```json
{
"results": [{ "url": "", "title": "" }]
}
```
### research response
```json
{
"answer": "综合研究报告",
"findings": [{ "content": "", "sources": [] }]
}
```Related Skills
tavily-search
Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.
baidu-search
Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.
Twitter Command Center (Search + Post)
Searches and reads X (Twitter): profiles, timelines, mentions, followers, tweet search, trends, lists, communities, and Spaces. Publishes posts after the user completes OAuth in the browser. Use when the user asks about Twitter/X data, social listening, or posting without sharing account passwords.
openclaw-search
Intelligent search for agents. Multi-source retrieval with confidence scoring - web, academic, and Tavily in one unified API.
aisa-tavily
AI-optimized web search via AIsa's Tavily API proxy. Returns concise, relevant results for AI agents through AIsa's unified API gateway.
search-for-service
Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers "what can I do?", "find me an API for...", "what services are available?", "search for...", "browse the bazaar".
search-cluster
Aggregated search aggregator using Google CSE, GNews RSS, Wikipedia, Reddit, and Scrapling.
alphashop-sel-product-search
商品搜索API SKILL:通过关键词搜索发现Amazon/TikTok平台商品。 支持价格、销量、评分、上架时间等多维度筛选条件。 通过 AlphaShop REST API 调用遨虾AI选品系统的商品搜索服务。
1688-product-search
1688商品搜索SKILL:提供完整的1688商品搜索能力,包括类目查询、关键词搜索、图片搜索、商品详情、相关性商品、拉取货盘底池等9个核心接口。 支持多语言搜索和商品推荐,使用1688开放平台官方API,统一鉴权,Token全局缓存共享。
exa-web-search-free
Free AI search via Exa MCP. Web search for news/info, code search for docs/examples from GitHub/StackOverflow, company research for business intel. No API key needed.
duckduckgo-search
Performs web searches using DuckDuckGo to retrieve real-time information from the internet. Use when the user needs to search for current events, documentation, tutorials, or any information that requires web search capabilities.
youtube-search
YouTube Search API via AIsa unified endpoint. Search YouTube videos, channels, and playlists with a single AIsa API key — no Google API key or OAuth required. Use this skill when users want to search YouTube content. For other AIsa capabilities (LLM, financial data, Twitter, web search), see the aisa-core skill.