Overview
Serper provides fast, affordable access to Google Search results via API. Get structured search results including web, images, news, and more.Installation
Environment Variables
How It Works
Quick Start
1
Simple Usage
2
With Configuration
Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.
Usage with Agent
Available Methods
search(query, num_results=10)
Search Google for web results.news(query, num_results=10)
Search Google News.images(query, num_results=10)
Search Google Images.Configuration Options
Function-Based Usage
CLI Usage
Error Handling
Common Errors
Best Practices
Let SERPER_API_KEY come from the environment
Let SERPER_API_KEY come from the environment
SerperTool() defaults to the SERPER_API_KEY env var. Set it in your shell or .env rather than passing api_key= inline.Cap num_results
Cap num_results
search(query, num_results=10) defaults to 10. Lower it so the agent processes fewer tokens and responds faster.Pick the right endpoint
Pick the right endpoint
Serper exposes
search, news, and images. Route the agent to the endpoint that matches the task to avoid noisy results.Related Tools
Tavily
AI-powered search
DuckDuckGo
Privacy-focused search
Exa
Neural search

