Skip to main content

Web Search

The web_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

1

Get an API key

Pick a provider and get an API key. See the provider pages below for sign-up links.
2

Configure

This stores the key and sets the provider. You can also set an env var (e.g. BRAVE_API_KEY) and skip this step.
3

Use it

The agent can now call web_search:

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

Auto-detection

Provider lists in docs and setup flows are alphabetical. Auto-detection keeps a separate precedence order: If no provider is set, OpenClaw checks for API keys in this order and uses the first one found:
  1. BraveBRAVE_API_KEY or plugins.entries.brave.config.webSearch.apiKey
  2. GeminiGEMINI_API_KEY or plugins.entries.google.config.webSearch.apiKey
  3. GrokXAI_API_KEY or plugins.entries.xai.config.webSearch.apiKey
  4. KimiKIMI_API_KEY / MOONSHOT_API_KEY or plugins.entries.moonshot.config.webSearch.apiKey
  5. PerplexityPERPLEXITY_API_KEY / OPENROUTER_API_KEY or plugins.entries.perplexity.config.webSearch.apiKey
  6. FirecrawlFIRECRAWL_API_KEY or plugins.entries.firecrawl.config.webSearch.apiKey
  7. TavilyTAVILY_API_KEY or plugins.entries.tavily.config.webSearch.apiKey
If no keys are found, it falls back to Brave (you will get a missing-key error prompting you to configure one).
All provider key fields support SecretRef objects. In auto-detect mode, OpenClaw resolves only the selected provider key — non-selected SecretRefs stay inactive.

Config

Provider-specific config (API keys, base URLs, modes) lives under plugins.entries.<plugin>.config.webSearch.*. See the provider pages for examples.

Storing API keys

Run openclaw configure --section web or set the key directly:

Tool parameters

Not all parameters work with all providers. Brave llm-context mode rejects ui_lang, freshness, date_after, and date_before. Firecrawl and Tavily only support query and count through web_search — use their dedicated tools for advanced options.

Examples

Tool profiles

If you use tool profiles or allowlists, add web_search or group:web:
  • Web Fetch — fetch a URL and extract readable content
  • Web Browser — full browser automation for JS-heavy sites