---
source_url: "https://langchain-doc.readthedocs.io/en/latest/ecosystem/serpapi.html?utm_source=openai"
title: SerpAPI — 🦜🔗 LangChain 0.0.107
mirrored_at: 2026-08-16T15:03:08.300Z
host: langchain-doc.readthedocs.io
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/langchain-doc.readthedocs.io/en/latest/ecosystem/serpapi.html__q__utm_source_openai"
---

> **Original source:** https://langchain-doc.readthedocs.io/en/latest/ecosystem/serpapi.html?utm_source=openai

## Contents

-   [Installation and Setup](#installation-and-setup)
-   [Wrappers](#wrappers)
    -   [Utility](#utility)
    -   [Tool](#tool)

## SerpAPI[#](#serpapi "Permalink to this headline")

This page covers how to use the SerpAPI search APIs within LangChain. It is broken into two parts: installation and setup, and then references to the specific SerpAPI wrapper.

## Installation and Setup[#](#installation-and-setup "Permalink to this headline")

-   Install requirements with `pip install google-search-results`
    
-   Get a SerpAPI api key and either set it as an environment variable (`SERPAPI_API_KEY`)
    

## Wrappers[#](#wrappers "Permalink to this headline")

### Utility[#](#utility "Permalink to this headline")

There exists a SerpAPI utility which wraps this API. To import this utility:

from langchain.utilities import SerpAPIWrapper

For a more detailed walkthrough of this wrapper, see [this notebook](https://langchain-doc.readthedocs.io/en/latest/modules/utils/examples/serpapi.html).

### Tool[#](#tool "Permalink to this headline")

You can also easily load this wrapper as a Tool (to use with an Agent). You can do this with:

from langchain.agents import load\_tools
tools \= load\_tools(\["serpapi"\])

For more information on this, see [this page](https://langchain-doc.readthedocs.io/en/latest/modules/agents/tools.html)