research
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseResearch Skill
Research Skill
Conduct comprehensive research on any topic with automatic source gathering, analysis, and response generation with citations.
对任意主题开展全面研究,自动收集来源、分析并生成带引用的回复。
Prerequisites
前提条件
Tavily API Key Required - Get your key at https://tavily.com
Add to :
~/.claude/settings.jsonjson
{
"env": {
"TAVILY_API_KEY": "tvly-your-api-key-here"
}
}需要Tavily API Key - 前往https://tavily.com获取你的密钥。
添加到中:
~/.claude/settings.jsonjson
{
"env": {
"TAVILY_API_KEY": "tvly-your-api-key-here"
}
}Quick Start
快速开始
Tip: Research can take 30-120 seconds. Press Ctrl+B to run in the background.
提示:研究过程可能需要30-120秒。按Ctrl+B可在后台运行。
Using the Script
使用脚本
bash
./scripts/research.sh '<json>' [output_file]Examples:
bash
undefinedbash
./scripts/research.sh '<json>' [output_file]示例:
bash
undefinedBasic research
Basic research
./scripts/research.sh '{"input": "quantum computing trends"}'
./scripts/research.sh '{"input": "quantum computing trends"}'
With pro model for comprehensive analysis
With pro model for comprehensive analysis
./scripts/research.sh '{"input": "AI agents comparison", "model": "pro"}'
./scripts/research.sh '{"input": "AI agents comparison", "model": "pro"}'
Save to file
Save to file
./scripts/research.sh '{"input": "market analysis for EVs", "model": "pro"}' ./ev-report.md
./scripts/research.sh '{"input": "market analysis for EVs", "model": "pro"}' ./ev-report.md
With custom citation format
With custom citation format
./scripts/research.sh '{"input": "climate change impacts", "model": "mini", "citation_format": "apa"}'
./scripts/research.sh '{"input": "climate change impacts", "model": "mini", "citation_format": "apa"}'
With structured output schema
With structured output schema
./scripts/research.sh '{"input": "fintech startups 2025", "model": "pro", "output_schema": {"properties": {"summary": {"type": "string"}, "companies": {"type": "array", "items": {"type": "string"}}}, "required": ["summary"]}}'
undefined./scripts/research.sh '{"input": "fintech startups 2025", "model": "pro", "output_schema": {"properties": {"summary": {"type": "string"}, "companies": {"type": "array", "items": {"type": "string"}}}, "required": ["summary"]}}'
undefinedBasic Research
基础研究
bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "Latest developments in quantum computing",
"model": "mini",
"stream": false,
"citation_format": "numbered"
}'Note: Streaming is disabled for token management. The call waits until research completes and returns clean JSON.
bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "Latest developments in quantum computing",
"model": "mini",
"stream": false,
"citation_format": "numbered"
}'注意:为了管理令牌,流式传输已禁用。调用会等待研究完成后返回整洁的JSON。
With Custom Schema
使用自定义模式
bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "Electric vehicle market analysis",
"model": "pro",
"stream": false,
"citation_format": "numbered",
"output_schema": {
"properties": {
"market_overview": {
"type": "string",
"description": "2-3 sentence overview of the market"
},
"key_players": {
"type": "array",
"description": "Major companies in this market",
"items": {
"type": "object",
"properties": {
"name": {"type": "string", "description": "Company name"},
"market_share": {"type": "string", "description": "Approximate market share"}
},
"required": ["name"]
}
}
},
"required": ["market_overview", "key_players"]
}
}'bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "Electric vehicle market analysis",
"model": "pro",
"stream": false,
"citation_format": "numbered",
"output_schema": {
"properties": {
"market_overview": {
"type": "string",
"description": "2-3 sentence overview of the market"
},
"key_players": {
"type": "array",
"description": "Major companies in this market",
"items": {
"type": "object",
"properties": {
"name": {"type": "string", "description": "Company name"},
"market_share": {"type": "string", "description": "Approximate market share"}
},
"required": ["name"]
}
}
},
"required": ["market_overview", "key_players"]
}
}'API Reference
API参考
Endpoint
端点
POST https://api.tavily.com/researchPOST https://api.tavily.com/researchHeaders
请求头
| Header | Value |
|---|---|
| |
| |
| 请求头 | 值 |
|---|---|
| |
| |
Request Body
请求体
| Field | Type | Default | Description |
|---|---|---|---|
| string | Required | Research topic or question |
| string | | Model: |
| boolean | | Streaming disabled for token management |
| object | null | JSON schema for structured output |
| string | | Citation format: |
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 字符串 | 必填 | 研究主题或问题 |
| 字符串 | | 模型: |
| 布尔值 | | 为了管理令牌,流式传输已禁用 |
| 对象 | null | 用于结构化输出的JSON模式 |
| 字符串 | | 引用格式: |
Response Format (JSON)
响应格式(JSON)
With , the response is clean JSON:
stream: falsejson
{
"content": "# Research Results\n\n...",
"sources": [{"url": "https://...", "title": "Source Title"}],
"response_time": 45.2
}当时,响应为整洁的JSON:
stream: falsejson
{
"content": "# Research Results\n\n...",
"sources": [{"url": "https://...", "title": "Source Title"}],
"response_time": 45.2
}Model Selection
模型选择
Rule of thumb: "what does X do?" -> mini. "X vs Y vs Z" or "best way to..." -> pro.
| Model | Use Case | Speed |
|---|---|---|
| Single topic, targeted research | ~30s |
| Comprehensive multi-angle analysis | ~60-120s |
| API chooses based on complexity | Varies |
经验法则:“X有什么作用?” -> 使用mini模型。“X vs Y vs Z”或“最佳方法是……” -> 使用pro模型。
| 模型 | 使用场景 | 速度 |
|---|---|---|
| 单一主题、针对性研究 | ~30秒 |
| 全面多角度分析 | ~60-120秒 |
| API根据复杂度自动选择 | 视情况而定 |
Schema Usage
模式使用
Schemas make output structured and predictable. Every property MUST include both and .
typedescriptionjson
{
"properties": {
"summary": {
"type": "string",
"description": "2-3 sentence executive summary"
},
"key_points": {
"type": "array",
"description": "Main takeaways",
"items": {"type": "string"}
}
},
"required": ["summary", "key_points"]
}模式可让输出结构化且可预测。每个属性必须同时包含和。
typedescriptionjson
{
"properties": {
"summary": {
"type": "string",
"description": "2-3 sentence executive summary"
},
"key_points": {
"type": "array",
"description": "Main takeaways",
"items": {"type": "string"}
}
},
"required": ["summary", "key_points"]
}Examples
示例
Market Research
市场研究
bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "Fintech startup landscape 2025",
"model": "pro",
"stream": false,
"citation_format": "numbered",
"output_schema": {
"properties": {
"market_overview": {"type": "string", "description": "Executive summary of fintech market"},
"top_startups": {
"type": "array",
"description": "Notable fintech startups",
"items": {
"type": "object",
"properties": {
"name": {"type": "string", "description": "Startup name"},
"focus": {"type": "string", "description": "Primary business focus"},
"funding": {"type": "string", "description": "Total funding raised"}
},
"required": ["name", "focus"]
}
},
"trends": {"type": "array", "description": "Key market trends", "items": {"type": "string"}}
},
"required": ["market_overview", "top_startups"]
}
}'bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "Fintech startup landscape 2025",
"model": "pro",
"stream": false,
"citation_format": "numbered",
"output_schema": {
"properties": {
"market_overview": {"type": "string", "description": "Executive summary of fintech market"},
"top_startups": {
"type": "array",
"description": "Notable fintech startups",
"items": {
"type": "object",
"properties": {
"name": {"type": "string", "description": "Startup name"},
"focus": {"type": "string", "description": "Primary business focus"},
"funding": {"type": "string", "description": "Total funding raised"}
},
"required": ["name", "focus"]
}
},
"trends": {"type": "array", "description": "Key market trends", "items": {"type": "string"}}
},
"required": ["market_overview", "top_startups"]
}
}'Technical Comparison
技术对比
bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "LangGraph vs CrewAI for multi-agent systems",
"model": "pro",
"stream": false,
"citation_format": "mla"
}'bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "LangGraph vs CrewAI for multi-agent systems",
"model": "pro",
"stream": false,
"citation_format": "mla"
}'Quick Overview
快速概览
bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "What is retrieval augmented generation?",
"model": "mini",
"stream": false
}'bash
curl --request POST \
--url https://api.tavily.com/research \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": "What is retrieval augmented generation?",
"model": "mini",
"stream": false
}'