research

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Research 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.json
:
json
{
  "env": {
    "TAVILY_API_KEY": "tvly-your-api-key-here"
  }
}
需要Tavily API Key - 前往https://tavily.com获取你的密钥。
添加到
~/.claude/settings.json
中:
json
{
  "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
undefined
bash
./scripts/research.sh '<json>' [output_file]
示例:
bash
undefined

Basic 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"]}}'
undefined

Basic 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/research
POST https://api.tavily.com/research

Headers

请求头

HeaderValue
Authorization
Bearer <TAVILY_API_KEY>
Content-Type
application/json
请求头
Authorization
Bearer <TAVILY_API_KEY>
Content-Type
application/json

Request Body

请求体

FieldTypeDefaultDescription
input
stringRequiredResearch topic or question
model
string
"mini"
Model:
mini
,
pro
,
auto
stream
boolean
false
Streaming disabled for token management
output_schema
objectnullJSON schema for structured output
citation_format
string
"numbered"
Citation format:
numbered
,
mla
,
apa
,
chicago
字段类型默认值描述
input
字符串必填研究主题或问题
model
字符串
"mini"
模型:
mini
pro
auto
stream
布尔值
false
为了管理令牌,流式传输已禁用
output_schema
对象null用于结构化输出的JSON模式
citation_format
字符串
"numbered"
引用格式:
numbered
mla
apa
chicago

Response Format (JSON)

响应格式(JSON)

With
stream: false
, the response is clean JSON:
json
{
  "content": "# Research Results\n\n...",
  "sources": [{"url": "https://...", "title": "Source Title"}],
  "response_time": 45.2
}
stream: false
时,响应为整洁的JSON:
json
{
  "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.
ModelUse CaseSpeed
mini
Single topic, targeted research~30s
pro
Comprehensive multi-angle analysis~60-120s
auto
API chooses based on complexityVaries
经验法则:“X有什么作用?” -> 使用mini模型。“X vs Y vs Z”或“最佳方法是……” -> 使用pro模型。
模型使用场景速度
mini
单一主题、针对性研究~30秒
pro
全面多角度分析~60-120秒
auto
API根据复杂度自动选择视情况而定

Schema Usage

模式使用

Schemas make output structured and predictable. Every property MUST include both
type
and
description
.
json
{
  "properties": {
    "summary": {
      "type": "string",
      "description": "2-3 sentence executive summary"
    },
    "key_points": {
      "type": "array",
      "description": "Main takeaways",
      "items": {"type": "string"}
    }
  },
  "required": ["summary", "key_points"]
}
模式可让输出结构化且可预测。每个属性必须同时包含
type
description
json
{
  "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
  }'