Install
openclaw skills install brave-api-searchReal-time web search, autosuggest, and AI-powered answers using the official Brave Search API. Use for searching documentation, facts, current events, or any web content. Supports AI grounded answers with citations and query autosuggest. Requires BRAVE_SEARCH_API_KEY and BRAVE_ANSWERS_API_KEY.
openclaw skills install brave-api-searchReal-time web search, autosuggest, spellcheck, and AI-powered answers using the official Brave Search API. Four tools:
brave_search — web results with titles, URLs, descriptions, optional AI summarybrave_suggest — query autosuggestions as users type with optional rich metadatabrave_spellcheck — spell correction and "Did you mean?" suggestionsbrave_answers — AI-grounded answers with inline citations powered by live web search
| NEW — v4.2.0: Full entity extraction via enable-entities flagSet your Brave API keys in a local .env file (recommended):
# .env (do not commit)
BRAVE_SEARCH_API_KEY=your_key_here
BRAVE_ANSWERS_API_KEY=your_key_here
AUTOSUGGEST_API_KEY=your_key_here # optional, for autosuggest only
BRAVE_SPELLCHECK_API_KEY=your_key_here # optional, for spellcheck only
Get your keys at: https://api-dashboard.search.brave.com
Key routing:
brave_search → BRAVE_SEARCH_API_KEYbrave_answers → BRAVE_ANSWERS_API_KEYbrave_suggest → AUTOSUGGEST_API_KEY → BRAVE_AUTOSUGGEST_API_KEY → BRAVE_SEARCH_API_KEY (tries in order)brave_spellcheck → BRAVE_SPELLCHECK_API_KEY → BRAVE_SEARCH_API_KEY (tries in order)Note:
brave_answersuses streaming by default. Streaming is required for citations, entities, and research mode.
Use brave_search when:
Use brave_suggest when:
Use brave_answers when:
Don't use this skill for:
Web search returning ranked results with titles, URLs, and descriptions.
brave_search --query "latest Node.js release" --count 5
brave_search --query "TypeScript generics" --extra-snippets true
brave_search --query "current weather Copenhagen" --freshness pd
brave_search --query "React Server Components" --summary true
Parameters:
query (required) — Search query, supports operators: site:, "exact phrase", -excludecount — Results to return (1-20, default: 10)country — 2-letter country code (default: us)freshness — Date filter: pd (24h), pw (7 days), pm (31 days), py (1 year)extra-snippets — Include up to 5 extra text excerpts per result (default: false)summary — Fetch Brave AI summarizer result (default: false)offset — Pagination offset for next page resultsReturns: Formatted list of results with title, URL, description, optional AI summary, and a hint for next page if more_results_available.
Query autosuggest API providing intelligent query autocompletion as users type.
brave_suggest --query "hello"
brave_suggest --query "pyt" --count 5 --country US
brave_suggest --query "einstein" --rich true
Parameters:
query (required) — Partial query to get suggestions forcount — Number of suggestions (1-10, default: 5)country — 2-letter country code (default: US)rich — Include enhanced metadata: titles, descriptions, images, entity detection (default: false, requires paid Autosuggest plan)Returns: List of query suggestions, optionally with rich metadata. Results are cached for 60 seconds.
Best Practices:
Spell checking and query correction for search queries.
brave_spellcheck --query "articifial inteligence"
brave_spellcheck --query "hello" --country US
Parameters:
query (required) — Query to check for spelling errorscountry — 2-letter country code (default: US)Returns: "Did you mean:" suggestion, or confirms no correction needed. Uses dedicated BRAVE_SPELLCHECK_API_KEY if available, falls back to BRAVE_SEARCH_API_KEY.
AI-powered answers grounded in live web search with inline citations.
brave_answers --query "How does React Server Components work?"
brave_answers --query "Compare Postgres vs MySQL for OLAP" --enable-research true
brave_answers --query "Latest Python release notes" --enable-citations true
brave_answers --query "Who is Albert Einstein" --enable-entities true
Parameters:
query (required) — Question or topic to researchcountry — Target country for search context (default: us)enable-citations — Include inline source citations (default: true)enable-research — Multi-search deep research mode (default: false)enable-entities — Include entity information in responses (default: false, streaming required)stream — Enable streaming output (default: true — required for citations/entities/research)Returns: AI answer with cited sources extracted from the response, plus token usage and cost breakdown.
⚠️ Citations, entities, and research mode require streaming (
--stream true, which is the default). If you disable streaming with--stream false, citations and entity data will not be available.
Streaming mode output:
<enum_item> tags are parsedNon-streaming fallback: Use --stream false for simpler output at the cost of losing citations and entity data.
Brave pricing is credit-based and can change. Do not assume a fixed free request count.
Current public guidance (verify in Brave dashboard/docs before production use):
$5 in monthly credits)Always check your live limits and usage in:
The skill uses a shared utils.js module containing:
parseArgs() — CLI argument parserfetchWithRetry() — fetch with exponential backoff retry on 429 and 5xxcreateCache() — in-memory TTL cache (used by brave_suggest)The core search script with the following optimizations:
--summary is enabled, the summary key is extracted from the search response and fetched in parallel with the search resultsmore_results_available is trueRetry-After header) and 5xx (exponential backoff)The AI answers script supports two modes:
parseCitations() and parseEntities()Key changes in v4.2.0:
<enum_item> tags incrementally — entity names are streamed inline as they are parsed, and a consolidated Entities mentioned section is printed at the end with URL and citation count per entityparseCitations() and parseEntities() applied to the batch response content, so citations and entities are extracted even without streamingThe autosuggest script with the following optimizations:
query|count|country|rich — deduplicates rapid successive callsAUTOSUGGEST_API_KEY → BRAVE_AUTOSUGGEST_API_KEY → BRAVE_SEARCH_API_KEYWhen streaming is enabled (stream: true):
<enum_item>) are parsed incrementally — streamed inline and collected for the Entities mentioned section<usage>) parsed and displayed with token counts and total costhttps://api.search.brave.com/res/v1.BRAVE_SEARCH_API_KEY and BRAVE_ANSWERS_API_KEY (keep them in .env, not inline in commands/chats).AUTOSUGGEST_API_KEY or BRAVE_AUTOSUGGEST_API_KEY for autosuggest.