Overview
The GoogleSearch tool is a tool that allows you to search the web using the GoogleSearch API.How It Works
Getting Started
Simple Usage
- Install dependencies (see Overview above)
- Set required API keys in your environment
- Run the agent example in Overview
Best Practices
Keep credentials in the environment
Keep credentials in the environment
Set
GOOGLE_API_KEY and GOOGLE_CSE_ID in your shell or .env. GoogleSearchAPIWrapper reads them automatically — never hard-code them.Watch the daily quota
Watch the daily quota
The Programmable Search API has a free daily query cap. Cache repeated queries and cap results so agents do not exhaust the quota mid-task.
Handle empty or blocked results
Handle empty or blocked results
Some queries return no results or hit quota errors. Wrap the call in
try/except so the agent can fall back to another search tool.Related Tools
Serper
Google search API
Google Serper Search
LangChain Serper wrapper
Tavily
AI-powered search

