Web Search
Theweb_search tool searches the web using your configured provider and
returns results. Results are cached by query for 15 minutes (configurable).
web_search is a lightweight HTTP tool, not browser automation. For JS-heavy sites or logins, use
the Web Browser. For fetching a specific URL, use Web
Fetch.Quick start
Configure
BRAVE_API_KEY) and skip this step.Choosing a provider
Brave Search
Structured results with snippets. Supports
llm-context mode, country/language filters. Free
tier available.DuckDuckGo
Key-free fallback. No API key needed. Unofficial HTML-based integration.
Exa
Neural + keyword search with content extraction (highlights, text, summaries).
Firecrawl
Structured results. Best paired with
firecrawl_search and firecrawl_scrape for deep
extraction.Gemini
AI-synthesized answers with citations via Google Search grounding.
Grok
AI-synthesized answers with citations via xAI web grounding.
Kimi
AI-synthesized answers with citations via Moonshot web search.
Perplexity
Structured results with content extraction controls and domain filtering.
Tavily
Structured results with search depth, topic filtering, and
tavily_extract for URL extraction.Provider comparison
| Provider | Result style | Filters | API key |
|---|---|---|---|
| Brave | Structured snippets | Country, language, time, llm-context mode | BRAVE_API_KEY |
| DuckDuckGo | Structured snippets | — | None (key-free) |
| Exa | Structured + extracted | Neural/keyword mode, date, content extraction | EXA_API_KEY |
| Firecrawl | Structured snippets | Via firecrawl_search tool | FIRECRAWL_API_KEY |
| Gemini | AI-synthesized + citations | — | GEMINI_API_KEY |
| Grok | AI-synthesized + citations | — | XAI_API_KEY |
| Kimi | AI-synthesized + citations | — | KIMI_API_KEY / MOONSHOT_API_KEY |
| Perplexity | Structured snippets | Country, language, time, domains, content limits | PERPLEXITY_API_KEY / OPENROUTER_API_KEY |
| Tavily | Structured snippets | Via tavily_search tool | TAVILY_API_KEY |
Auto-detection
Provider lists in docs and setup flows are alphabetical. Auto-detection keeps a separate precedence order: If noprovider is set, OpenClaw checks for API keys in this order and uses
the first one found:
- Brave —
BRAVE_API_KEYorplugins.entries.brave.config.webSearch.apiKey - Gemini —
GEMINI_API_KEYorplugins.entries.google.config.webSearch.apiKey - Grok —
XAI_API_KEYorplugins.entries.xai.config.webSearch.apiKey - Kimi —
KIMI_API_KEY/MOONSHOT_API_KEYorplugins.entries.moonshot.config.webSearch.apiKey - Perplexity —
PERPLEXITY_API_KEY/OPENROUTER_API_KEYorplugins.entries.perplexity.config.webSearch.apiKey - Firecrawl —
FIRECRAWL_API_KEYorplugins.entries.firecrawl.config.webSearch.apiKey - Tavily —
TAVILY_API_KEYorplugins.entries.tavily.config.webSearch.apiKey
All provider key fields support SecretRef objects. In auto-detect mode, OpenClaw resolves only the
selected provider key — non-selected SecretRefs stay inactive.
Config
plugins.entries.<plugin>.config.webSearch.*. See the provider pages for
examples.
Storing API keys
- Config file
- Environment variable
Run
openclaw configure --section web or set the key directly:Tool parameters
| Parameter | Description |
|---|---|
query | Search query (required) |
count | Results to return (1-10, default: 5) |
country | 2-letter ISO country code (e.g. “US”, “DE”) |
language | ISO 639-1 language code (e.g. “en”, “de”) |
freshness | Time filter: day, week, month, or year |
date_after | Results after this date (YYYY-MM-DD) |
date_before | Results before this date (YYYY-MM-DD) |
ui_lang | UI language code (Brave only) |
domain_filter | Domain allowlist/denylist array (Perplexity only) |
max_tokens | Total content budget, default 25000 (Perplexity only) |
max_tokens_per_page | Per-page token limit, default 2048 (Perplexity only) |
Examples
Tool profiles
If you use tool profiles or allowlists, addweb_search or group:web:
Related
- Web Fetch — fetch a URL and extract readable content
- Web Browser — full browser automation for JS-heavy sites
This page is sourced from openclaw/openclaw.