How to connect Serpapi to Google ADK in 2 mins: No API key needed

You can check where you rank on Google, build a list of local businesses and compare prices for a product across stores from Google ADK. Composio runs each call on its own Serpapi account, so you don't need a Serpapi API key, and your first $2 is free.

SerpapiInstant · No API key

Google ADK runs Serpapi through Composio, and the cost comes out of your free $2.

  • Google results for a search$0.025
  • Businesses from Google Maps$0.025
  • Product prices from Google Shopping$0.025

$2 ≈ 80 searches

Composio Instant

What you can do with your free $2

What your free $2 gets you with Serpapi
When you ask Google ADK forGoogle ADK uses this toolCostWhat $2 gets you
Google results for a searchGoogle Light Search$0.025 per searchAbout 80 searches
Businesses from Google MapsGoogle maps search$0.025 per searchAbout 80 searches
Product prices from Google ShoppingShopping search$0.025 per searchAbout 80 searches
News articles on a topicSearch for news articles$0.025 per searchAbout 80 searches
Search interest from Google TrendsGoogle Trends search$0.025 per searchAbout 80 searches
Research papers from Google ScholarSearch Google Scholar$0.025 per searchAbout 80 searches

You pay Serpapi's price for each call with 0% markup, plus the regular Composio tool call charge. There's no Serpapi subscription, and you only pay for what you use.

44 of 59 Serpapi tools work without a key. For Amazon Search, Get SerpApi Account, Amazon Product, Get Location Options, Google AI Overview, Google Jobs Listing and 9 more, connect your own Serpapi key. Read how Instant works.

How it works

How to connect Serpapi to Google ADK

Composio adds Serpapi to Google ADK as an Instant toolkit. You connect Composio to Google ADK once, and then Google ADK can use Serpapi right away. There are two ways to do this:

  • Bring your own key

    You bring your own Serpapi API key, set it up, and use it.

  • Use the Composio wallet

    Instant

    Composio runs each call on its own Serpapi account, so you don't have to set anything up at Serpapi, and your first $2 is free.

You do the setup one time and it takes about a minute. If you build Serpapi into your own product, turn on Instant toolkits in your project settings so your agent can call Serpapi for each of your users without a Serpapi API key, and read Instant tools in the Composio docs for the setup steps and code examples.

Get started

Start to use Serpapi in Google ADK in 3 steps

  1. Turn on Instant

    Open your Composio wallet and turn on Instant. Your free $2 shows up there.

  2. Add Composio to Google ADK

    Follow the setup below. You only do this once.

  3. Ask Google ADK for something

    Try a Serpapi prompt. The cost comes out of your $2.

Setup

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • A Google API key for Gemini models
  • A Composio account and API key
  • Python 3.9 or later installed
  • Basic familiarity with Python
2

Getting API Keys for Google and Composio

Google API Key
  • Go to Google AI Studio and create an API key.
  • Copy the key and keep it safe. You will put this in GOOGLE_API_KEY.
Composio API Key and User ID
  • Log in to the Composio dashboard.
  • Go to Settings → API Keys and copy your Composio API key. Use this for COMPOSIO_API_KEY.
  • Decide on a stable user identifier to scope sessions, often your email or a user ID. Use this for COMPOSIO_USER_ID.
3

Install dependencies

bash
pip install google-adk composio python-dotenv

Inside your virtual environment, install the required packages.

What's happening:

  • google-adk is Google's Agents Development Kit
  • composio connects your agent to Serpapi via MCP
  • python-dotenv loads environment variables
4

Set up ADK project

bash
adk create my_agent

Set up a new Google ADK project.

What's happening:

  • This creates an agent folder with a root agent file and .env file
5

Set environment variables

bash
GOOGLE_API_KEY=your-google-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-id-or-email

Save all your credentials in the .env file.

What's happening:

  • GOOGLE_API_KEY authenticates with Google's Gemini models
  • COMPOSIO_API_KEY authenticates with Composio
  • COMPOSIO_USER_ID identifies the user for session management
6

Import modules and validate environment

python
import os
import warnings

from composio import Composio
from dotenv import load_dotenv
from google.adk.agents.llm_agent import Agent
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset

load_dotenv()

warnings.filterwarnings("ignore", message=".*BaseAuthenticatedTool.*")

GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not GOOGLE_API_KEY:
    raise ValueError("GOOGLE_API_KEY is not set in the environment.")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment.")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment.")
What's happening:
  • os reads environment variables
  • Composio is the main Composio SDK client
  • GoogleProvider declares that you are using Google ADK as the agent runtime
  • Agent is the Google ADK LLM agent class
  • McpToolset lets the ADK agent call MCP tools over HTTP
7

Create Composio client and Tool Router session

python
composio_client = Composio(api_key=COMPOSIO_API_KEY)

composio_session = composio_client.create(
    user_id=COMPOSIO_USER_ID,
    toolkits=["serpapi"],
)

COMPOSIO_MCP_URL = composio_session.mcp.url,
print(f"Composio MCP URL: {COMPOSIO_MCP_URL}")
What's happening:
  • Authenticates to Composio with your API key
  • Declares Google ADK as the provider
  • Spins up a short-lived MCP endpoint for your user and selected toolkit
  • Stores the MCP HTTP URL for the ADK MCP integration
8

Set up the McpToolset and create the Agent

python
composio_toolset = McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url=COMPOSIO_MCP_URL,
        headers={"x-api-key": COMPOSIO_API_KEY}
    )
)

root_agent = Agent(
    model="gemini-2.5-flash",
    name="composio_agent",
    description="An agent that uses Composio tools to perform actions.",
    instruction=(
        "You are a helpful assistant connected to Composio. "
        "You have the following tools available: "
        "COMPOSIO_SEARCH_TOOLS, COMPOSIO_MULTI_EXECUTE_TOOL, "
        "COMPOSIO_MANAGE_CONNECTIONS, COMPOSIO_REMOTE_BASH_TOOL, COMPOSIO_REMOTE_WORKBENCH. "
        "Use these tools to help users with Serpapi operations."
    ),
    tools=[composio_toolset],
)

print("\nAgent setup complete. You can now run this agent directly ;)")
What's happening:
  • Connects the ADK agent to the Composio MCP endpoint through McpToolset
  • Uses Gemini as the model powering the agent
  • Lists exact tool names in instruction to reduce misnamed tool calls
9

Run the agent

bash
# Run in CLI mode
adk run my_agent

# Or run in web UI mode
adk web

Execute the agent from the project root. The web command opens a web portal where you can chat with the agent.

What's happening:

  • adk run runs the agent in CLI mode
  • adk web . opens a web UI for interactive testing

Complete Code

Here's the complete code to get you started with Serpapi and Google ADK:

python
import os
import warnings

from composio import Composio
from composio_google import GoogleProvider
from dotenv import load_dotenv
from google.adk.agents.llm_agent import Agent
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset

load_dotenv()
warnings.filterwarnings("ignore", message=".*BaseAuthenticatedTool.*")

GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not GOOGLE_API_KEY:
    raise ValueError("GOOGLE_API_KEY is not set in the environment.")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment.")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment.")

composio_client = Composio(api_key=COMPOSIO_API_KEY, provider=GoogleProvider())

composio_session = composio_client.create(
    user_id=COMPOSIO_USER_ID,
    toolkits=["serpapi"],
)

COMPOSIO_MCP_URL = composio_session.mcp.url


composio_toolset = McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url=COMPOSIO_MCP_URL,
        headers={"x-api-key": COMPOSIO_API_KEY}
    )
)

root_agent = Agent(
    model="gemini-2.5-flash",
    name="composio_agent",
    description="An agent that uses Composio tools to perform actions.",
    instruction=(
        "You are a helpful assistant connected to Composio. "
        "You have the following tools available: "
        "COMPOSIO_SEARCH_TOOLS, COMPOSIO_MULTI_EXECUTE_TOOL, "
        "COMPOSIO_MANAGE_CONNECTIONS, COMPOSIO_REMOTE_BASH_TOOL, COMPOSIO_REMOTE_WORKBENCH. "
        "Use these tools to help users with Serpapi operations."
    ),  
    tools=[composio_toolset],
)

print("\nAgent setup complete. You can now run this agent directly ;)")
Try it

Ask Google ADK for something with Serpapi

Start a new chat and try this prompt:

Search Google from [city] for each of these keywords and tell me what position [your domain] is in within the top 20 results, plus the top 3 results for each keyword: [paste up to 5 keywords].

Google ADK runs it on Instant and shows you the result. It doesn't ask you for a Serpapi key, and the cost comes out of your $2. You can see each call in your wallet.

Optional: connect your own Serpapi key

If you want Amazon Search, Get SerpApi Account, Amazon Product, Get Location Options, Google AI Overview, Google Jobs Listing and 9 more, you need your own key. Ask Google ADK to connect your Serpapi account, and it gives you a Composio link:

Connect my Serpapi account using Composio.

Open the link, paste your Serpapi API key and click Connect Account. You can get a key from SerpApi dashboard. After that, Composio uses your key first and doesn't charge Instant for those calls.

Starter prompts

Use your first $2: copy a prompt into Google ADK

Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.

  • Check where you rank on Google

    About $0.25

    Checks the top 20 Google results from a city for each keyword and tells you where your site shows up.

    Search Google from [city] for each of these keywords and tell me what position [your domain] is in within the top 20 results, plus the top 3 results for each keyword: [paste up to 5 keywords].

  • Build a list of local businesses

    About $0.03

    Pulls about 20 businesses of one type from Google Maps with their phone number, website and rating.

    Find [type of business] in [city] on Google Maps and give me a table with each one's name, address, phone number, website, rating and number of reviews.

  • Compare prices for a product across stores

    About $0.03

    Searches Google Shopping and lists who sells a product and at what price, cheapest first.

    Search Google Shopping for [product name and model] and give me a table of the stores selling it, the price at each and any discount shown, sorted from cheapest to most expensive.

  • Compare search interest over time

    About $0.03

    Pulls Google Trends interest for up to 5 terms so you can see which one is growing.

    Compare Google Trends interest over the past 12 months for [term 1], [term 2] and [term 3]. Tell me which one is growing fastest and when each one peaked.

  • Catch up on news about a company or topic

    About $0.03

    Pulls recent Google News articles on a topic and sums up the main stories with links.

    Find the latest news about [company or topic] and give me a short summary of the 5 biggest stories, each with the source, date and link.

  • See what ads a competitor is running

    About $0.03

    Looks up a competitor's public Google ads and shows how many they run, in which formats, and which ones have run the longest.

    Look up the public Google ads for [competitor domain]. Tell me how many ads they're running, how many are text, image and video, and list the 10 that have run the longest with their first and last shown dates and a link to view each one.

  • Summarize a patent's claims and citations

    About $0.03

    See the main claims and cited work for a patent ID in one short report.

    I have this patent ID: [patent ID]. Get its details and summarize the main claims in plain language. List the patents it cites and any filing or publication dates returned. Include source links where available and mark missing details clearly.

  • Compare apps across mobile stores

    About $0.05

    Compare app listings for the same task on Google Play and the Apple App Store.

    I need an app for [task]. Search Google Play and the Apple App Store for [search phrase]. Compare up to three relevant apps from each store by name, developer, rating, and features mentioned in the listing. Include a link for each and mark fields the results do not show.

  • Find beginner videos on a topic

    About $0.03

    Get a short list of relevant tutorial videos with links and available details.

    I want to learn [topic]. Search YouTube and give me five videos that look useful for a beginner. Include each title, channel, link, and duration when returned. Explain your picks using only the search result details.

  • Read Korean search results in English

    About $0.03

    Get an English overview of Korean search results for a topic.

    I want to see Korean-language search results for [topic]. Search Naver and give me five result titles, source links, and brief English summaries based only on the result text. Say when a result lacks enough detail to summarize.

What it can do

What Google ADK can do with Serpapi

Works without a key

  • Google results for a search
  • Businesses from Google Maps
  • Product prices from Google Shopping
  • News articles on a topic
  • Search interest from Google Trends
  • Research papers from Google Scholar

Needs your own Serpapi key

  • Amazon Search
  • Get SerpApi Account
  • Amazon Product
  • Get Location Options
  • Google AI Overview
  • Google Jobs Listing
  • Get Search Archive
  • YouTube Video
  • and 7 more
Tools and prices

Supported tools (59)

Serpapi tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Search Baidu with QuerySearch Baidu (Chinese search engine) and retrieve search results.Yes$0.025 per successful search
Bing Maps SearchSearch Bing Maps via SerpApi for local businesses and places, using a required query and an optional place ID.Yes$0.025 per successful search
Bing SearchRetrieve Bing Search Engine Results via SerpAPI.Yes$0.025 per successful search
DuckDuckGo Light SearchTool to access the world's fastest DuckDuckGo Search API via SerpApi.Yes$0.025 per successful search
DuckDuckGo Maps searchScrapes DuckDuckGo Maps results via SerpApi.Yes$0.025 per successful search
DuckDuckGo searchPerforms a DuckDuckGo search via SerpApi to retrieve SERP data, including organic results, ads, and structured information.Yes$0.025 per successful search
eBay SearchSearch eBay product listings via SerpApi using keywords and optional location and marketplace settings.Yes$0.025 per successful search
Search Google EventsSearches for events in Google Search's structured event results.Yes$0.025 per successful search
Search financeRetrieves structured financial information (e.g., company data, stock details, market trends, news) from Google Finance via SERP API based on a query.Yes$0.025 per successful search
Get Facebook profile informationTool to retrieve public information from a Facebook profile or page using SerpAPI.Yes$0.025 per successful search
Get Google About This ResultTool to get Google 'About this result' information for a website.Yes$0.025 per successful search
Get Google Hotels AutocompleteTool to get autocomplete suggestions for Google Hotels destination searches.Yes$0.025 per successful search
Get Google Images Related ContentGet related content for a specific Google Images result.Yes$0.025 per successful search
Get Google Patent DetailsTool to retrieve detailed information about a specific patent or scholar document from Google Patents via SerpApi.Yes$0.025 per successful search
Google Forums SearchTool to scrape forum results from Google's Forums Platform using SerpApi.Yes$0.025 per successful search
Google Jobs SearchRetrieve Google Jobs search results via SerpApi, with pagination, location and remote-job filtering.Yes$0.025 per successful search
Google Lens searchPerforms reverse image search using Google Lens to find visually similar images, products, and related content.Yes$0.025 per successful search
Google Light SearchRetrieve Google Light Search Results via SerpApi.Yes$0.025 per successful search
Google maps searchPerforms a Google Maps search via SERP API.Yes$0.025 per successful search
Google Play Product SearchTool to retrieve detailed Google Play product information using SerpApi.Yes$0.025 per successful search
Show all 59 tools
More Serpapi tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Google Scholar Author ProfileScrapes full Google Scholar Author page including articles, citations, metrics, and co-authors.Yes$0.025 per successful search
Google Scholar CiteScrapes full Google Scholar Citations with multiple citation formats.Yes$0.025 per successful search
Google Videos Light SearchTool to scrape Google Videos results using SerpApi's ultra-fast Google Videos Light API.Yes$0.025 per successful search
Hotel SearchSearch Google Hotels via SerpApi using a query and check-in and check-out dates, or retrieve property details with a property token.Yes$0.025 per successful search
Image searchSearches Google Images via SERP API for a given query, returning structured image results.Yes$0.025 per successful search
Naver SearchSearch Naver for Korean web content, news, videos, and shopping results.Yes$0.025 per successful search
Search for news articlesSearch Google news results via SerpApi for articles matching a query.Yes$0.025 per successful search
OpenTable Reviews SearchTool to scrape OpenTable restaurant reviews using SerpApi.Yes$0.025 per successful search
Google Play SearchRetrieve Google Play Store search results in JSON, with query, country, language, category, chart, and pagination options.Yes$0.025 per successful search
Search Google ScholarSearches Google Scholar via SerpApi for academic literature, papers, articles, and citations based on a query.Yes$0.025 per successful search
Serp API searchSearch Google via SerpApi and return up to five organic results nested under results.organic_results, with position, title, and link for each.Yes$0.025 per successful search
Search Apple App StoreTool to search Apple App Store for iOS and Mac apps.Yes$0.025 per successful search
Google Images Light SearchTool to scrape Google Images results using SerpApi's Google Images Light API.Yes$0.025 per successful search
Search Google Local ServicesSearch Google Local Services for providers such as electricians, plumbers and HVAC technicians.Yes$0.025 per successful search
Search public Google adsFind public Google advertisements by advertiser or domain.Yes$0.025 per successful search
Search Yelp businessesSearch Yelp for businesses and places using SerpApi.Yes$0.025 per successful search
Shopping searchSearches Google Shopping via SerpAPI for a specific product, returning structured listings in results.shopping_results.Yes$0.025 per successful search
Google Trends searchFetches Google Trends data; returns relative 0–100 interest indices (not absolute volumes) meaningful only when comparing queries within the same request.Yes$0.025 per successful search
Walmart SearchRetrieve Walmart search results by query, location, store ID, and other parameters.Yes$0.025 per successful search
Yahoo SearchRetrieve Yahoo!Yes$0.025 per successful search
Yahoo Videos SearchScrape Yahoo!Yes$0.025 per successful search
Yandex Images SearchTool to search Yandex Images for image results with advanced filters.Yes$0.025 per successful search
Yandex SearchRetrieve Yandex Search Results.Yes$0.025 per successful search
YouTube SearchRetrieve YouTube Search Results.Yes$0.025 per successful search
Amazon SearchSearch Amazon by keyword or category for products, prices, and ratings.Needs your own keyBilled to your own Serpapi key
Get SerpApi AccountReturn plan, usage, remaining searches, renewal, throughput, and extra credits.Needs your own keyBilled to your own Serpapi key
Amazon ProductRetrieve Amazon product details, variants, sellers, and related items by ASIN.Needs your own keyBilled to your own Serpapi key
Get Location OptionsTool to get available location options for Google searches.Needs your own keyBilled to your own Serpapi key
Google AI OverviewRetrieve the full AI Overview referenced by a fresh Google Search page token.Needs your own keyBilled to your own Serpapi key
Google Jobs ListingRetrieve employer ratings for a job ID returned by Google Jobs Search.Needs your own keyBilled to your own Serpapi key
Get Search ArchiveRetrieve an archived search by its search ID, including status and modeled result fields when available.Needs your own keyBilled to your own Serpapi key
YouTube VideoRetrieve YouTube video metadata, chapters, comments, and related videos.Needs your own keyBilled to your own Serpapi key
YouTube Video TranscriptRetrieve timestamped transcript content for a YouTube video.Needs your own keyBilled to your own Serpapi key
Google Domains ListRetrieve the list of supported Google domains for search queries.Needs your own keyBilled to your own Serpapi key
Google Maps PostsScrapes Google Maps Posts for a business location via SerpApi.Needs your own keyBilled to your own Serpapi key
Google Maps ReviewsRetrieve Google Maps place reviews, topics, place data, and pagination.Needs your own keyBilled to your own Serpapi key
Google AI ModeQuery Google AI Mode for generated text, references, and follow-up data.Needs your own keyBilled to your own Serpapi key
Search IndexSearch SerpApi's preview LLM-first web index for grounding results.Needs your own keyBilled to your own Serpapi key
Walmart Product ReviewsTool to scrape full Walmart product reviews using SerpApi's Walmart Product Reviews API.Needs your own keyBilled to your own Serpapi key
Pricing

How you pay for Serpapi

  • Your first $2 is freeIt's added to your Composio wallet when you turn on Instant.
  • You pay for each callYou pay Serpapi's price with 0% markup, plus the regular Composio tool call charge.
  • Your own key comes firstIf you connect your own Serpapi key, Composio uses it and doesn't charge Instant for those calls.
  • You control the costYou can ask your agent to check with you before each paid call, and you can turn Instant off at any time.
  • You can see each callYour wallet shows each call and what it cost.
  • When your balance runs outYou can add funds to your wallet on a Pro plan or connect your own key.
Help

Troubleshooting

  1. 1. Google ADK asks me for a Serpapi API key

    You may have asked for something that needs your own key, like Amazon Search, Get SerpApi Account, Amazon Product, Get Location Options, Google AI Overview, Google Jobs Listing and 9 more. Those tools don't run on Instant. For everything else, check that Instant is turned on in your Composio wallet, then ask again.

  2. 2. I can't see my free $2

    Open your wallet in the Composio dashboard and check that Instant is turned on. If the $2 still isn't there, email support@composio.dev from the address you signed up with.

  3. 3. A Serpapi call failed with a balance error

    Your balance is empty. Add funds to your wallet on a Pro plan, or connect your own Serpapi key, then try again.

FAQ

Frequently asked questions

Start with Serpapi.It takes 30 seconds.

New accounts get a one-time $2 starter credit for Instant calls.Run Serpapi from your agent with no Serpapi key.

Get $2 starter credit