crewaisearchagents

CrewAI Search Tool Integration Guide

Add real web search to CrewAI agents as a custom tool. Scavio search as CrewAI BaseTool. Compare with built-in SerperDevTool and TavilySearchTool.

8 min

CrewAI ships with SerperDevTool and a few other built-in search options, but adding a custom search provider gives you control over cost, platform coverage, and response format. Here is how to implement Scavio as a CrewAI BaseTool, with a side-by-side comparison to SerperDevTool and TavilySearchTool.

Custom search tool implementation

Python
import os, requests
from crewai.tools import BaseTool
from pydantic import Field

class ScavioSearchTool(BaseTool):
    name: str = "web_search"
    description: str = (
        "Search the web across Google, Amazon, YouTube, Reddit, "
        "Walmart, or TikTok. Returns structured JSON results."
    )
    api_key: str = Field(default_factory=lambda: os.environ["SCAVIO_API_KEY"])

    def _run(self, query: str, platform: str = "google") -> str:
        resp = requests.post(
            "https://api.scavio.dev/api/v1/search",
            headers={"x-api-key": self.api_key},
            json={"query": query, "platform": platform},
            timeout=15,
        )
        results = resp.json().get("organic_results", [])[:5]
        formatted = []
        for r in results:
            formatted.append(
                f"Title: {r.get('title', '')}\n"
                f"URL: {r.get('link', '')}\n"
                f"Snippet: {r.get('snippet', '')}"
            )
        return "\n---\n".join(formatted) if formatted else "No results found."

# Use in a CrewAI agent
search_tool = ScavioSearchTool()

Using the tool in a crew

Python
from crewai import Agent, Task, Crew

researcher = Agent(
    role="Market Researcher",
    goal="Find current pricing and features for CRM tools",
    backstory="You research software tools by searching multiple platforms.",
    tools=[ScavioSearchTool()],
    verbose=True,
)

task = Task(
    description="Research the top 5 CRM tools for startups in 2026. "
                "Include current pricing and key differentiators.",
    expected_output="A structured comparison of 5 CRM tools with pricing.",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task], verbose=True)
result = crew.kickoff()
print(result)

Comparison: SerperDevTool vs Tavily vs Scavio

  • SerperDevTool: built into CrewAI, Google-only, $0.001/search (Serper pricing), simple setup
  • TavilySearchTool: built into CrewAI, AI-summarized, 1K free/mo then $0.008/search, single-platform
  • ScavioSearchTool (custom): multi-platform (6 platforms), $0.005/search, structured JSON, requires BaseTool implementation

Multi-platform CrewAI agent

Python
class MultiPlatformSearchTool(BaseTool):
    name: str = "multi_platform_search"
    description: str = (
        "Search across multiple platforms simultaneously. "
        "Supports: google, amazon, youtube, reddit, walmart, tiktok."
    )
    api_key: str = Field(default_factory=lambda: os.environ["SCAVIO_API_KEY"])

    def _run(self, query: str, platforms: str = "google,reddit") -> str:
        all_results = []
        for platform in platforms.split(","):
            resp = requests.post(
                "https://api.scavio.dev/api/v1/search",
                headers={"x-api-key": self.api_key},
                json={"query": query, "platform": platform.strip()},
                timeout=15,
            )
            results = resp.json().get("organic_results", [])[:3]
            for r in results:
                all_results.append(
                    f"[{platform.strip().upper()}] {r.get('title', '')}: {r.get('link', '')}"
                )
        return "\n".join(all_results) if all_results else "No results found."

When to swap search providers

Use SerperDevTool when your agent only needs Google results and cost is the priority. Use TavilySearchTool when your agent needs pre-summarized context for reasoning tasks. Use a custom Scavio tool when your agent needs multi-platform data (comparing Amazon products, checking Reddit sentiment, and searching Google in the same task). The swap takes 5 minutes -- change the tool class and update the environment variable.