← 返回
未分类 Key 中文

Tavily Metered Search

Web search via Tavily API with built-in monthly usage tracking and quota management. Use when the user asks to search the web / look up sources / find links....
通过Tavily API进行网络搜索,内置每月用量追踪与配额管理。适用于用户请求搜索网页、查找资料来源或获取链接等场景。
neverland83 neverland83 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 417
下载
💾 7
安装
1
版本
#latest

概述

Tavily Metered Search

Web search with built-in usage tracking and quota management for Tavily API (free tier: 1000 searches/month).

Quick Start

# Basic search (Markdown output, default)
python3 {baseDir}/scripts/tavily_search.py --query "AI news today"

# With short answer
python3 {baseDir}/scripts/tavily_search.py --query "what is RAG" --include-answer

# JSON output
python3 {baseDir}/scripts/tavily_search.py --query "python tutorial" --format raw
python3 {baseDir}/scripts/tavily_search.py --query "python tutorial" --format brave

# Skip counting (for testing)
python3 {baseDir}/scripts/tavily_search.py --query "test" --no-count

Arguments

ArgumentDefaultDescription
--------------------------------
--query(required)Search query string
--max-results5Number of results (1-10), configurable via config file
--formatmdOutput: raw (JSON), brave (JSON), md (Markdown)
--include-answerfalseInclude AI-generated short answer
--search-depthbasicbasic or advanced, configurable via config file
--no-countfalseSkip usage tracking (still consumes API quota)

Configuration

Edit config/config.json to customize default settings:

{
  "limit": 900,
  "warningThreshold": 800,
  "searchDepth": "basic",
  "defaultMaxResults": 5
}
SettingDescriptionDefault
-------------------------------
limitMonthly limit, blocks search when reached900
warningThresholdWarning threshold, shows alert when reached800
searchDepthDefault search depthbasic
defaultMaxResultsDefault number of results5

Usage Tracking

  • Automatic tracking: Each successful search increments a counter stored in data/tavily-usage.json
  • Monthly reset: Counter resets on the 1st of each month
  • Limit enforcement: When limit is reached, search is blocked with a message suggesting web_fetch as alternative
  • Warning alert: When warningThreshold is reached, a reminder is appended to search results

Output Formats

md (default)

Human-readable Markdown list:

1. Title
   https://example.com
   - Snippet text...

raw

Full JSON with query, answer?, results: [{title, url, content}]

brave

Brave-like format: {query, results: [{title, url, snippet}], answer?}

Requirements

  • Tavily API key via either:
  • Environment variable: TAVILY_API_KEY
  • ~/.openclaw/.env file: TAVILY_API_KEY=tvly-...

Get a free API key at https://tavily.com

File Structure

tavily-metered-search/
├── SKILL.md                    # Skill documentation
├── scripts/
│   └── tavily_search.py        # Main search script
├── config/
│   └── config.json             # User configuration
└── data/
    └── tavily-usage.json       # Runtime state (auto-maintained)

Notes

  • Free tier: 1000 searches/month (default limit is 900 to leave buffer)
  • Keep --max-results small (3-5) to reduce token usage
  • Use --no-count for testing without affecting quota

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 22:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

knowledge-management

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 447 📥 105,301
knowledge-management

web-tools-guide

user_ec205dbb
MANDATORY before calling web_search, web_fetch, browser, or opencli. Contains required error-handling procedures (web_se
★ 76 📥 164,073
knowledge-management

Summarize

paudyyin
智能摘要工具,自动为长文本、文档、网页生成摘要,提取要点与关键词,支持自定义摘要长度。
★ 963 📥 520,311