OpenClaw Search Provider Selection Guide (Brave/Gemini/Grok/Tavily/SerpAPI, etc.)

AI Expert

Difficulty: Intermediate | Duration: 20 minutes | Takeaway: Master how to select the most suitable search provider for OpenClaw based on actual scenarios.

Target Audience

  • Developers who have completed the basic setup of OpenClaw and are ready to integrate search capabilities seriously.
  • Engineers facing 10+ providers and not knowing which one to choose.
  • Friends looking to deeply customize search behavior for specific scenarios (RAG / Public Opinion Monitoring / E-commerce Tracking, etc.).

Core Dependencies

  • OpenClaw (Latest version)
  • Node.js 18+
  • API Key for at least one search provider

Project Structure

openclaw/
├── config.yaml     # All provider configurations go here
└── .env            # Store API Keys here; do not commit to the repository

1. OpenClaw Search Capability Overview

In the OpenClaw Agentic Loop, the search tool acts as the "Real-time Perception Layer" — when the Agent determines its training data is insufficient, it proactively calls the search tool to supplement information before deciding on the next action.

User Question
   ↓
Agent Thinking: Do I need the latest information?
   ↓ Yes
Call Search Provider → Get Results
   ↓
Intergrate Information → Generate Answer

[!TIP]
Without a search provider, OpenClaw can only rely on the model's training data. It will hallucinate when encountering questions like "What is the latest version?" or "Today's news." Configuring search is the first step to making the Agent truly "alive."

Currently, OpenClaw supports 10 search providers, divided into two categories:

TypeProviderFeaturesFree TierStarting Price
OfficialPerplexityStructured results, time/domain filteringNone$1/M tokens
OfficialBrave SearchPrivacy-first, regional search~1,000 req/mo$5/1k
OfficialGeminiGoogle ecosystem, auto-groundingGenerous free tierPer prompt billing
OfficialGrokWeb + X platform dual searchNone$10/1k tool calls
OfficialKimi256K ultra-long contextNone$0.60/M tokens
Third-partyTavilyOptimized for LLMs, structured output1,000 req/moPay-as-you-go
Third-partySerper.devFastest and cheapest Google SERP2,500 free credits$0.30/1k
Third-partySerpAPIMulti-engine coverage, supports screenshots250 req/mo$7.50/1k
Third-partyExaSemantic neural network searchFree trialPay-as-you-go
Third-partyDataForSEOEnterprise-grade, 10+ engines$1 trial credit$0.60/1k

2. Core Dimensions for Selection

Align on these 4 dimensions before choosing a provider:

DimensionKey QuestionImpact on Decision
TimelinessHow fresh do the results need to be? Real-time / Weekly / Monthly?News scenarios must choose real-time indexing.
QualityDo you need raw link lists or pre-processed snippets?AI Agent scenarios prioritize snippet-type output.
CostWhat is the estimated monthly call volume?High-frequency scenarios offer huge savings potential.
FeaturesNeed domain allowlists / Geo-location simulation / Specific engines?Vertical features are critical for specific use cases.

3. Guide to 10 Major Scenarios

Scenario 1: Coding Q&A Agent

Requirements: Users ask "How to fix this error" or "What is the latest API for this library." Answers are usually on GitHub, Stack Overflow, or official docs.

Recommendation: Perplexity + searchDomainFilter

The reason is that Perplexity’s sonar model has the best understanding of technical content. Adding a domain allowlist forces results from authoritative technical sites, avoiding low-quality blogs.

tools:
  web:
    search:
      enabled: true
      provider: perplexity
      maxResults: 5
      perplexity:
        apiKey:
          source: env
          provider: default
          id: PERPLEXITY_API_KEY
        model: sonar                # Lightweight and fast, sufficient
        searchRecencyFilter: month  # Content within one month to filter old docs
        searchDomainFilter:
          - "github.com"
          - "stackoverflow.com"
          - "docs.python.org"
          - "developer.mozilla.org"
          - "pkg.go.dev"

Result: When the Agent answers code questions, all citations come from trusted technical sites, significantly increasing credibility.


Scenario 2: News Summary Bot

Requirements: Summarize the latest news in specific fields (AI / Tech / Finance) every morning. Timeliness is the top priority.

Recommendation: Serper.dev with type: news

Serper has a dedicated News endpoint that pulls real-time Google News results with 1–2 second latency. Its pricing is among the lowest of all providers.

tools:
  web:
    search:
      enabled: true
      provider: serper
      maxResults: 10
      cacheTtlMinutes: 30       # News cache for 30 minutes to save API costs
      serper:
        apiKey:
          source: env
          provider: default
          id: SERPER_API_KEY
        type: news              # Switch to News endpoint
        num: 10                 # Get 10 items per call

[!TIP]
Setting cacheTtlMinutes to 30 is reasonable for news—headlines don't change drastically within 30 minutes.


Scenario 3: Academic Research Agent

Requirements: Help researchers retrieve papers and analyze trends. Requires semantic understanding rather than just keyword matching.

Recommendation: Exa, Semantic Retrieval + Domain Filtering

Exa is based on embedding vector indexing. it understands queries like "Applications of quantum computing in cryptography" rather than just matching keywords like "quantum," "cryptography," and "computing."

tools:
  web:
    search:
      enabled: true
      provider: exa
      maxResults: 8
      exa:
        apiKey:
          source: env
          provider: default
          id: EXA_API_KEY
        endpoint: auto          # Automatically balance speed and quality
        includeDomains:
          - "arxiv.org"
          - "semanticscholar.org"
          - "pubmed.ncbi.nlm.nih.gov"
          - "nature.com"
          - "science.org"
        startPublishedDate: "2024-01-01"   # Only papers from 2024 onwards

Comparison with standard search: For the same query, Exa can find papers that are semantically related but don't contain the keywords in the title, leading to much higher recall.


Scenario 4: X/Twitter Sentiment Monitoring

Requirements: Track real-time discussions about brands, products, or topics on the X platform. Normal web searches cannot crawl X content effectively.

Recommendation: Grok, enable x_search

This is a unique capability of Grok — direct retrieval of X platform content, which other providers cannot do.

tools:
  web:
    search:
      enabled: true
      provider: grok
      grok:
        apiKey:
          source: env
          provider: default
          id: XAI_API_KEY
        model: grok-4-1-fast    # Optimized for agentic search
        inlineCitations: true
        tools:
          - type: x_search
            fromDate: "2025-01-01"      # Posts after a specific date
            allowedXHandles:            # Optional: Track specific accounts
              - "sama"
              - "karpathy"
              - "ylecun"
          - type: web_search            # Enable web search for background info
            enableImageUnderstanding: true

[!WARNING]
web_search and x_search each cost $10/1000 tool calls. For high-frequency monitoring, use cacheTtlMinutes or deduplication at the application layer.


Scenario 5: E-commerce Price Tracking

Requirements: Monitor price changes for competitors on Google Shopping or find the lowest price for a user.

Recommendation: SerpAPI, engine: google_shopping

SerpAPI is currently the only provider that offers comprehensive structured data for Google Shopping, including prices, merchants, and ratings.

tools:
  web:
    search:
      enabled: true
      provider: serpapi
      maxResults: 20
      cacheTtlMinutes: 60       # Cache price data for 1 hour
      serpapi:
        apiKey:
          source: env
          provider: default
          id: SERPAPI_API_KEY
        engine: google_shopping  # Switch to Shopping engine
        gl: us                   # US Market
        hl: en
        # Optional: Specify geographic simulation
        location: "New York, New York, United States"

Sample Response Data (SerpAPI Structured Output):

{
  "shopping_results": [
    {
      "title": "Product Name",
      "price": "$29.99",
      "source": "Amazon",
      "rating": 4.5,
      "reviews": 1234,
      "link": "https://..."
    }
  ]
}

Scenario 6: SEO Content Generation

Requirements: Batch analyze SERP structures (titles, snippets, competitor articles) to help content teams with topic strategy.

Recommendation: DataForSEO, mode: normal

DataForSEO's normal mode uses a queue (returns in ~5 mins) and costs only $0.0006/request—over 3x cheaper than live mode. SEO analysis doesn't usually require real-time results.

tools:
  web:
    search:
      enabled: true
      provider: dataforseo
      maxResults: 10
      cacheTtlMinutes: 1440     # SEO data changes slowly, cache for 24h
      dataforseo:
        login:
          source: env
          provider: default
          id: DATAFORSEO_LOGIN
        password:
          source: env
          provider: default
          id: DATAFORSEO_PASSWORD
        engine: google
        mode: normal            # Queue mode, $0.0006/req (live is $0.002)
        locationCode: 2840      # 2840 = US; 2826 = UK; 2392 = Japan
        languageCode: en

[!TIP]
DataForSEO uses locationCode for regions. Common codes: US 2840, UK 2826, Germany 2276, Japan 2392. Check the official list for more.


Scenario 7: Internal Corporate Knowledge Search

Requirements: The company has internal wikis and technical documentation. You want the Agent to prioritize these sources while shielding irrelevant external sites.

Recommendation: Brave Search + Goggles

Brave's Goggles feature allows for custom ranking rules—you can boost internal documentation sites while downranking or discarding competitor sites.

tools:
  web:
    search:
      enabled: true
      provider: brave
      maxResults: 8
      brave:
        apiKey:
          source: env
          provider: default
          id: BRAVE_API_KEY
        # Goggles URL: Obtained after creating/publishing at search.brave.com/goggles
        goggles_id: "https://raw.githubusercontent.com/your-org/goggles/main/internal-docs.goggle"
        freshness: pm           # Search content within the last month

Sample Goggles Config (.goggle file content):

# Boost internal docs
$boost=10,site=docs.yourcompany.com
$boost=10,site=wiki.yourcompany.com

# Downrank competitors
$downrank=5,site=competitor.com

# Discard low-quality content farms
$discard,site=spamsite.example

Scenario 8: Multilingual Market Research

Requirements: Perform global market analysis by simulating search results from different countries/languages to understand local competition.

Recommendation: SerpAPI with flexible location + hl + gl

SerpAPI supports precise geo-simulation, allowing you to "disguise" yourself as a user from a specific city.

tools:
  web:
    search:
      enabled: true
      provider: serpapi
      serpapi:
        apiKey:
          source: env
          provider: default
          id: SERPAPI_API_KEY
        engine: google
        # Example: Simulation of a user in Berlin, Germany
        location: "Berlin, Berlin, Germany"
        hl: de          # Interface language: German
        gl: de          # Region: Germany

Common Multi-market Configs:

Marketlocationhlgl
USANew York, New York, United Statesenus
UKLondon, England, United Kingdomengb
GermanyBerlin, Berlin, Germanydede
JapanTokyo, Tokyo, Japanjajp
FranceParis, Ile-de-France, Francefrfr
BrazilSão Paulo, São Paulo, Brazilptbr

Scenario 9: High-frequency Low-cost Batch Tasks

Requirements: An Agent triggers searches frequently (e.g., monitoring keywords every few minutes). Cost is the main concern.

Recommendation: Serper.dev Volume Tier + Aggressive Caching

Serper's pricing can be as low as $0.30/1k. Combining this with reasonable caching brings the total cost down to the industry minimum.

tools:
  web:
    search:
      enabled: true
      provider: serper
      maxResults: 5             # Be conservative with quantity
      timeoutSeconds: 15        # Fail fast
      cacheTtlMinutes: 120      # 2-hour cache
      serper:
        apiKey:
          source: env
          provider: default
          id: SERPER_API_KEY
        type: search
        num: 5

Cost Comparison (10,000 searches per month):

ProviderUnit PriceMonthly Cost
SerpAPI$7.50/1k$75
Perplexity sonar-pro~$3/1k approx$30
Serper.dev$0.30/1k$3
Tavily basic~$0.004/req$40

Scenario 10: Zero Budget ($0)

Requirements: Personal project or early validation stage. No desire to spend money, but still need functional search.

Strategy: Rotating free tiers

ProviderFree TierTotal
Brave Search~1,000 req/mo
Tavily1,000 req/mo
SerpAPI250 req/mo
Total~2,250 req/mo
tools:
  web:
    search:
      enabled: true
      provider: davily          # Primary: 1,000 free calls
      maxResults: 5
      cacheTtlMinutes: 60
      tavily:
        apiKey:
          source: env
          provider: default
          id: TAVILY_API_KEY
        searchDepth: basic      # Use basic (1 credit), not advanced (2 credits)
        maxResults: 5
        includeAnswer: true

When quota runs out, simply change provider: brave to switch.

4. Scenario → Provider Quick Lookup

ScenarioRecommended ProviderKey ParamEst. Cost (1k)
Coding Q&APerplexitysearchDomainFilter~$1
News SummarySerper.devtype: news$0.30–$1
Academic ResearchExaincludeDomains, endpoint: autoPay-as-you-go
X/Twitter SentimentGrokx_search$10/1k tools
Pricing TraceSerpAPIengine: google_shopping$7.50
SEO GenerationDataForSEOmode: normal$0.60
Internal KnowledgeBrave + Gogglesgoggles_id$5/1k
MultilingualSerpAPIlocation, hl, gl$7.50
High-freq BatchSerper.devcacheTtlMinutes: 120$0.30–$1
Zero BudgetTavily / BravesearchDepth: basic$0

5. Advanced: Multi-Provider Fallback Strategy

For production, configure a fallback strategy—automatically switch when the primary provider fails or hits the quota.

tools:
  web:
    search:
      enabled: true
      provider: perplexity      # Primary Provider
      maxResults: 5
      timeoutSeconds: 20        # Trigger fallback after 20s timeout
      perplexity:
        apiKey:
          source: env
          provider: default
          id: PERPLEXITY_API_KEY
        model: sonar

      # Fallback Provider
      fallback:
        provider: serper
        serper:
          apiKey:
            source: env
            provider: default
            id: SERPER_API_KEY
          type: search
          num: 5

6. Common Troubleshooting

Q1: Provider is configured, but Agent doesn't search.

Cause: The Agent's prompt doesn't guide it to use search, or the model thinks it doesn't need the internet.
Solution: Add a clear instruction in the system prompt:
"When you are unsure about the latest information, please actively use search tools to get real-time data; do not rely on training data to make guesses."

Q2: Perplexity searchDomainFilter is not working.

Cause: Incorrect domain format (do not include https://).
Solution: Use "github.com" instead of "https://github.com".

Q3: Serper.dev results differ from direct Google search.

Cause: Serper simulates US search by default.
Solution: Add the gl parameter (e.g., gl: gb for the UK).

Q4: Grok x_search doesn't return X content.

Cause: Use of deprecated search_parameters.
Solution: Ensure you are using the new tools: [{type: x_search}] format and update OpenClaw to the latest version.


Further Reading: