Serpapi

Learn how to use Serpapi with Composio

Overview

SLUG: SERPAPI

Description

SerpApi provides a real-time API for structured search engine results, allowing developers to scrape, parse, and analyze SERP data for SEO and research

Authentication Details

generic_api_key
stringRequired

Connecting to Serpapi

Create an auth config

Use the dashboard to create an auth config for the Serpapi toolkit. This allows you to connect multiple Serpapi accounts to Composio for agents to use.

1

Select App

Navigate to Serpapi.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Serpapi Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4serpapi_auth_config_id = "ac_YOUR_SERPAPI_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Serpapi for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, serpapi_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Serpapi toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Bing Maps Search

Description

Tool to scrape Bing Maps results using SerpApi. Use when you need to find local businesses, places, or get detailed location information including addresses, phone numbers, ratings, reviews, and more. Supports searching by query or specific place ID.

Action Parameters

count
cp
first
no_cache
place_id
q
stringRequired
setlang

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: DuckDuckGo Maps search

Description

Scrapes DuckDuckGo Maps results via SerpApi. Use when searching for location-based information like businesses, restaurants, or services in a specific geographic area. Returns structured data including ratings, reviews, addresses, operating hours, and contact information.

Action Parameters

bbox
lat
lon
q
stringRequired
strict_bbox

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Location Options

Description

Tool to get available location options for Google searches. Returns location names, codes, and identifiers that can be used in the location parameter. Use when you need to find valid location values for search queries.

Action Parameters

limit
q

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Google Domains List

Description

Retrieve the list of supported Google domains for search queries.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Google Maps Posts

Description

Scrapes Google Maps Posts for a business location via SerpApi. Extracts local posts published by business owners including titles, descriptions, links, images, and publication dates. Returns 10 posts per page with pagination support.

Action Parameters

data_id
stringRequired
next_page_token
no_cache

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Google Play Product Search

Description

Tool to retrieve detailed Google Play product information using SerpApi. Supports apps, movies, TV shows, audiobooks, and books. Use when you need product details, ratings, reviews, or media for Google Play Store items.

Action Parameters

all_reviews
async
engine
stringDefaults to google_play_product
gl
hl
next_page_token
no_cache
num
output
Defaults to json
platform
product_id
stringRequired
rating
season_id
sort_by
store
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Google Scholar Author Profile

Description

Scrapes full Google Scholar Author page including articles, citations, metrics, and co-authors. Use when you need detailed information about a specific researcher's publications and academic profile.

Action Parameters

author_id
stringRequired
citation_id
hl
no_cache
num
sort
start
view_op

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Google Scholar Cite

Description

Scrapes full Google Scholar Citations with multiple citation formats. Retrieves MLA, APA, Chicago, Harvard, and Vancouver style citations along with download links for BibTeX, EndNote, RefMan, and RefWorks. Use when you need formatted citations for a specific research paper identified by its Google Scholar ID.

Action Parameters

hl
no_cache
q
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Google Videos Light Search

Description

Tool to scrape Google Videos results using SerpApi's ultra-fast Google Videos Light API. Use when you need video titles, links, thumbnails, snippets, upload dates, and durations from Google Videos search. This lighter version excludes rich results for faster response times.

Action Parameters

async_req
device
engine
stringDefaults to google_videos_light
filter
gl
google_domain
hl
json_restrictor
location
lr
nfpr
no_cache
output
q
stringRequired
safe
start
tbs
uule
zero_trace

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Locations

Description

List Locations

Action Parameters

limit
q

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: OpenTable Reviews Search

Description

Tool to scrape OpenTable restaurant reviews using SerpApi. Retrieves user reviews, ratings, restaurant responses, images, and AI-generated summaries. Use when you need detailed review data for OpenTable restaurants.

Action Parameters

async
json_restrictor
no_cache
open_table_domain
output
page
place_id
stringRequired
zero_trace

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Walmart Product Reviews

Description

Tool to scrape full Walmart product reviews using SerpApi's Walmart Product Reviews API. Retrieves ratings, review text, user information, and helpful votes for a specific product. Use when you need detailed customer feedback and sentiment analysis for Walmart products.

Action Parameters

async
no_cache
output
Defaults to json
page
product_id
stringRequired
rating
sort

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Yahoo Videos Search

Description

Scrape Yahoo! Videos results with position, title, thumbnail, link, preview, source, duration, date and more. Use when you need to search for video content on Yahoo! Videos.

Action Parameters

async
b
device
durs
no_cache
output
Defaults to json
p
stringRequired
vage
vres
vsite
yahoo_domain
zero_trace

Action Response

data
objectRequired
error
successful
booleanRequired