← 返回
开发者工具 Key 中文

Brave Rotator

Brave Search API with automatic key rotation across multiple API keys to maximize free tier limits (2000 req/month per key). Use when performing web, news, o...
Brave Search API,支持多密钥自动轮换以最大化免费额度(每钥每月2000次请求)。适用于网页、新闻等搜索。
mrnsmh
开发者工具 clawhub v0.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 538
下载
💾 8
安装
1
版本
#latest

概述

Brave Rotator

Multi-key Brave Search with automatic round-robin rotation and rate-limit fallback.

Setup

Set env var with comma-separated keys:

export BRAVE_API_KEYS=key1,key2,key3

Optionally set state file path (default: ~/.brave_key_state.json):

export BRAVE_KEY_STATE_FILE=/path/to/state.json

Script: scripts/brave_search.py

Run directly or import as module.

CLI usage

python3 brave_search.py "your query" [--count 5] [--type web|news|image] [--country us] [--lang en] [--json]

Import usage

import sys, os
sys.path.insert(0, "path/to/skill/scripts")
from brave_search import search, format_results

data, used_key, key_idx = search("your query", count=5, search_type="web")
results = format_results(data, "web")
# results = [{"title": ..., "url": ..., "snippet": ...}, ...]

Rotation Logic

  • Maintains state in ~/.brave_key_state.json
  • Round-robin across all keys
  • On HTTP 429/403: blocks key for 60s, retries with next key
  • All keys exhausted: uses least recently blocked key

Key State Inspection

cat ~/.brave_key_state.json

Shows per-key request count, last success, and blocked_until timestamps.

Search Types

TypeEndpointResult fields
--------------------------------------------------------------------
web/web/searchtitle, url, snippet
news/news/searchtitle, url, snippet, age
image/images/searchtitle, url, thumbnail

Notes

  • Free plan: 2000 req/month/key, 1 req/sec
  • With N keys: effectively N×2000 req/month
  • See references/brave-api.md for full API params and plan details

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-30 06:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,903
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 66 📥 179,938
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,756