Skip to content
Back to skills

Openclaw Skill Brave Rotator

ASecurity

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, or image searches via Brave Search API, especially when multiple API keys are available and you want to avoid rate limits. Triggers on web search requests, news lookups, image searches, any task requiring Brave Search API calls with key rotation or fallback.

  • 14 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 7, 2026
developmentpythonbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill openclaw-skill-brave-rotator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openclaw Skill Brave Rotator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openclaw Skill Brave Rotator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-openclaw-skill-brave-rotator/badge)](https://www.skillsdirectory.com/skills/modbender-openclaw-skill-brave-rotator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: brave-rotator
description: >
  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, or image searches via Brave Search API,
  especially when multiple API keys are available and you want to avoid rate limits.
  Triggers on web search requests, news lookups, image searches, any task requiring
  Brave Search API calls with key rotation or fallback.
---

# Brave Rotator

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

## Setup

Set env var with comma-separated keys:
```bash
export BRAVE_API_KEYS=key1,key2,key3
```

Optionally set state file path (default: `~/.brave_key_state.json`):
```bash
export BRAVE_KEY_STATE_FILE=/path/to/state.json
```

## Script: `scripts/brave_search.py`

Run directly or import as module.

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

### Import usage
```python
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

```bash
cat ~/.brave_key_state.json
```

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

## Search Types

| Type  | Endpoint              | Result fields                        |
|-------|-----------------------|--------------------------------------|
| web   | /web/search           | title, url, snippet                  |
| news  | /news/search          | title, url, snippet, age             |
| image | /images/search        | title, 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

Files in this skill

  • SKILL.md2.2 KB
  • references/brave-api.md1.7 KB
  • scripts/brave_search.py6.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…