Overview
The SearchApi tool is a tool that allows you to search the web using the SearchApi.How It Works
Getting Started
1
Simple Usage
- Install dependencies (see Overview above)
- Set required API keys in your environment
- 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
Keep SEARCHAPI_API_KEY in the environment
Keep SEARCHAPI_API_KEY in the environment
Set
SEARCHAPI_API_KEY in your shell or .env. SearchApiAPIWrapper reads it automatically — never hard-code the key.Scope the query
Scope the query
SearchApi returns broad web results. Give the agent specific queries so it processes fewer, more relevant hits.
Handle rate limits
Handle rate limits
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.Related Tools
Serp Search
SerpAPI wrapper
Google Search
LangChain Google search
Tavily
AI-powered search

