Google Serper API
Google Serper API runs Google searches through Serper, a service that gives access to Google results with a single key. You don’t need to set up your own search engine in Google.
You can use it as a tool, connecting its Tool output to the Tools input of an agent: the agent decides when to search and what to type, and receives a text summary of the results. You can also use it as a step in the flow, writing the search in Input and collecting the results from the Data output.
When to use it
- An assistant needs current information from the web to answer.
- You want an agent to check public details, such as a business’s address or opening hours.
- A flow searches for news on a topic every week and stores it.
- You need Google results without creating a programmable search engine.
Configuration
You need a Google Serper credential with your Serper key. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Google Serper credential used for searches. |
| Input | The text to search for. Only used with the Data output; when you connect the Tool output the field is hidden, because the agent writes the search. |
| Number of results (required) | How many results are taken into account in each search. Defaults to 4. |
Output
- Tool: connects to an agent’s Tools input. The agent receives a text with the most relevant parts of the results.
- Data: a list with one item per Google result, with its title, link and snippet.
When you connect one of the two outputs, the other one is hidden.
Example
A restaurant chain wants an internal assistant that answers managers’ quick questions.
- Add Google Serper API and pick the Google Serper credential.
- Connect its Tool output to the agent’s Tools input.
- A manager asks “Which public holidays are there in Valencia next month?”. The agent searches Google and answers with the dates.
Related components
- Google Custom Search Tool: searches with your own Google search engine.
- Serp Search API and SearchApi Tool: other search results services.