← 返回
未分类 Key 中文

Search

Search the web using Tavily's LLM-optimized search API. Returns relevant results with content snippets, scores, and metadata. Use when you need to find web content on any topic without writing code.
使用 Tavily 的 LLM 优化搜索 API 在网上搜索,返回包含内容片段、评分和元数据的相关结果。适用于无需编写代码即可查找任意主题的网页内容。
barneyjm
未分类 clawhub v0.1.0 1 版本 99875.5 Key: 需要
★ 0
Stars
📥 1,604
下载
💾 4
安装
1
版本
#latest

概述

Search Skill

Search the web and get relevant results optimized for LLM consumption.

Prerequisites

Tavily API Key Required - Get your key at https://tavily.com

Add to ~/.claude/settings.json:

{
  "env": {
    "TAVILY_API_KEY": "tvly-your-api-key-here"
  }
}

Quick Start

Using the Script

./scripts/search.sh '<json>'

Examples:

# Basic search
./scripts/search.sh '{"query": "python async patterns"}'

# With options
./scripts/search.sh '{"query": "React hooks tutorial", "max_results": 10}'

# Advanced search with filters
./scripts/search.sh '{"query": "AI news", "topic": "news", "time_range": "week", "max_results": 10}'

# Domain-filtered search
./scripts/search.sh '{"query": "machine learning", "include_domains": ["arxiv.org", "github.com"], "search_depth": "advanced"}'

Basic Search

curl --request POST \
  --url https://api.tavily.com/search \
  --header "Authorization: Bearer $TAVILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "latest developments in quantum computing",
    "max_results": 5
  }'

Advanced Search

curl --request POST \
  --url https://api.tavily.com/search \
  --header "Authorization: Bearer $TAVILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "machine learning best practices",
    "max_results": 10,
    "search_depth": "advanced",
    "include_domains": ["arxiv.org", "github.com"],
    "chunks_per_source": 3
  }'

API Reference

Endpoint

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

Headers

HeaderValue
---------------
AuthorizationBearer
Content-Typeapplication/json

Request Body

FieldTypeDefaultDescription
-----------------------------------
querystringRequiredSearch query (keep under 400 chars)
max_resultsinteger5Maximum results (0-20)
search_depthstring"basic"ultra-fast, fast, basic, advanced
topicstring"general"general, news, finance
chunks_per_sourceinteger3Chunks per source (advanced/fast only)
time_rangestringnullday, week, month, year
include_domainsarray[]Domains to include (max 300)
exclude_domainsarray[]Domains to exclude (max 150)
include_answerbooleanfalseInclude AI-generated answer
include_raw_contentbooleanfalseInclude full page content
include_imagesbooleanfalseInclude image results

Response Format

{
  "query": "latest developments in quantum computing",
  "results": [
    {
      "title": "Page Title",
      "url": "https://example.com/page",
      "content": "Extracted text snippet...",
      "score": 0.85
    }
  ],
  "response_time": 1.2
}

Search Depth

DepthLatencyRelevanceContent Type
-----------------------------------------
ultra-fastLowestLowerNLP summary
fastLowGoodChunks
basicMediumHighNLP summary
advancedHigherHighestChunks

When to use each:

  • ultra-fast: Real-time chat, autocomplete
  • fast: Need chunks but latency matters
  • basic: General-purpose, balanced
  • advanced: Precision matters (default recommendation)

Examples

News Search

curl --request POST \
  --url https://api.tavily.com/search \
  --header "Authorization: Bearer $TAVILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "AI news today",
    "topic": "news",
    "time_range": "day",
    "max_results": 10
  }'

Domain-Filtered Search

curl --request POST \
  --url https://api.tavily.com/search \
  --header "Authorization: Bearer $TAVILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "Python async best practices",
    "include_domains": ["docs.python.org", "realpython.com", "github.com"],
    "search_depth": "advanced"
  }'

Search with Full Content

curl --request POST \
  --url https://api.tavily.com/search \
  --header "Authorization: Bearer $TAVILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "React hooks tutorial",
    "max_results": 3,
    "include_raw_content": true
  }'

Finance Search

curl --request POST \
  --url https://api.tavily.com/search \
  --header "Authorization: Bearer $TAVILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "AAPL earnings Q4 2024",
    "topic": "finance",
    "max_results": 10
  }'

Tips

  • Keep queries under 400 characters - Think search query, not prompt
  • Break complex queries into sub-queries - Better results than one massive query
  • Use include_domains to focus on trusted sources
  • Use time_range for recent information
  • Filter by score (0-1) to get highest relevance results

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-21 12:21 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Journey

barneyjm
多站点旅程规划,支持路线优化、可行性分析及时间预算约束。适用于规划多停靠点行程或检查行程是否可行。
★ 0 📥 1,632

Query

barneyjm
使用Camino AI的位置智能API通过自然语言搜索地点。返回包含坐标、距离和元数据的相关结果。适用于查找餐厅、商店、地标或任何兴趣点等真实世界位置。
★ 2 📥 1,658

Places

barneyjm
使用灵活的查询格式定位地点(自由文本搜索或结构化地址)。返回坐标、地址及可选的街景照片。用于地址地理编码或查找特定名称的地点。
★ 2 📥 1,712