Skip to main content
The Google Serper Search tool lets an agent query Google results through the Serper API.

Overview

The Google Serper Search tool is a tool that allows you to search the web using the Google Serper API.

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 SERPER_API_KEY in your shell or .env. GoogleSerperAPIWrapper reads it automatically — never hard-code the key.
Create a single GoogleSerperAPIWrapper() and pass it to the agent. It is cheaper than re-instantiating per call.
Serper returns HTTP 429 when the plan quota is exceeded. Wrap the call in try/except so the agent can degrade to another search tool.

Serper

Google search API

Google Search

LangChain Google search

Serp Search

SerpAPI wrapper