SerperApiTools enable an Agent to search Google for a query.

Prerequisites

The following example requires an API key from SerperApi.

export SERPER_API_KEY=***

Example

The following agent will search Google for the query: “Whats happening in the USA” and share results.

cookbook/tools/serper_tools.py
from agno.agent import Agent
from agno.tools.serper import SerperTools

agent = Agent(tools=[SerperTools(location="us")], show_tool_calls=True)
agent.print_response("Whats happening in the USA?", markdown=True)

Toolkit Params

ParameterTypeDefaultDescription
api_keystr-API key for authentication purposes.
locationstr"us"Location to search from.

Toolkit Functions

FunctionDescription
search_googleThis function searches Google for a query.

Developer Resources