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")])
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.
enable_searchboolTrueEnable the search functionality.
enable_search_newsboolTrueEnable the search_news functionality.
enable_search_scholarboolTrueEnable the search_scholar functionality.
enable_scrape_webpageboolTrueEnable the scrape_webpage functionality.
allboolFalseEnable all functionality.

Toolkit Functions

FunctionDescription
search_googleThis function searches Google for a query.
search_newsThis function searches Google News for a query.
search_scholarThis function searches Google Scholar for a query.
scrape_webpageThis function scrapes a webpage for a query.

Developer Resources