Skip to main content
The SearchApi tool lets an agent search the web through the SearchApi service.

Overview

The SearchApi tool is a tool that allows you to search the web using the SearchApi.
export SEARCHAPI_API_KEY="${SEARCHAPI_API_KEY:?Set SEARCHAPI_API_KEY in your shell}"
from praisonaiagents import Agent, AgentTeam
from langchain_community.utilities import SearchApiAPIWrapper

data_agent = Agent(instructions="I am looking for the top google searches of 2025", tools=[SearchApiAPIWrapper])
editor_agent = Agent(instructions="Analyze the data and derive insights")

agents = AgentTeam(agents=[data_agent, editor_agent])
agents.start()

How It Works

Getting Started

1

Simple Usage

  1. Install dependencies (see Overview above)
  2. Set required API keys in your environment
  3. Run the agent example in Overview
2

With Configuration

Use the same tool with an agent — see the Overview example, or pass env vars from the sections above.

Best Practices

Set SEARCHAPI_API_KEY in your shell or .env. SearchApiAPIWrapper reads it automatically — never hard-code the key.
SearchApi returns broad web results. Give the agent specific queries so it processes fewer, more relevant hits.
SearchApi returns HTTP 429 when the plan quota is exceeded. Wrap the call in try/except so the agent can fall back to another search tool.

Serp Search

SerpAPI wrapper

Google Search

LangChain Google search

Tavily

AI-powered search