---
source_url: "https://docs.langchain.com/oss/python/integrations/tools/google_search?utm_source=openai"
title: Google search integration - Docs by LangChain
mirrored_at: 2026-08-10T03:39:32.950Z
host: docs.langchain.com
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/docs.langchain.com/oss/python/integrations/tools/google_search__q__utm_source_openai"
---

> **Original source:** https://docs.langchain.com/oss/python/integrations/tools/google_search?utm_source=openai

This notebook goes over how to use the google search component. First, you need to set up the proper API keys and environment variables. To set it up, create the `GOOGLE_API_KEY` in the Google Cloud credential console ([console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials)) and a GOOGLE\_CSE\_ID using the Programmable Search Engine ([programmablesearchengine.google.com/controlpanel/create](https://programmablesearchengine.google.com/controlpanel/create)). Next, it is good to follow the [instructions for programmatic Google Search](https://stackoverflow.com/questions/37083058/programmatically-searching-google-in-python-using-custom-search). Then we will need to set some environment variables.

## Number of results

You can use the `k` parameter to set the number of results

‘The official home of the Python Programming Language.‘

Run query through GoogleSearch and return snippet, title, and link metadata.

-   Snippet: The description of the result.
-   Title: The title of the result.
-   Link: The link to the result.

* * *