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
integer
cp
string
first
integer
no_cache
boolean
place_id
string
q
stringRequired
setlang
string

Action Response

data
objectRequired
error
string
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
string
lat
number
lon
number
q
stringRequired
strict_bbox
integer

Action Response

data
objectRequired
error
string
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
integer
q
string

Action Response

data
objectRequired
error
string
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
string
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
string
no_cache
boolean

Action Response

data
objectRequired
error
string
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
boolean
async
boolean
engine
stringDefaults to google_play_product
gl
string
hl
string
next_page_token
string
no_cache
boolean
num
integer
output
stringDefaults to json
platform
string
product_id
stringRequired
rating
integer
season_id
string
sort_by
integer
store
stringRequired

Action Response

data
objectRequired
error
string
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
string
hl
string
no_cache
boolean
num
integer
sort
string
start
integer
view_op
string

Action Response

data
objectRequired
error
string
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
string
no_cache
boolean
q
stringRequired

Action Response

data
objectRequired
error
string
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
boolean
device
string
engine
stringDefaults to google_videos_light
filter
integer
gl
string
google_domain
string
hl
string
json_restrictor
string
location
string
lr
string
nfpr
integer
no_cache
boolean
output
string
q
stringRequired
safe
string
start
integer
tbs
string
uule
string
zero_trace
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Locations

Description

List Locations

Action Parameters

limit
integer
q
string

Action Response

data
objectRequired
error
string
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
boolean
json_restrictor
string
no_cache
boolean
open_table_domain
string
output
string
page
integer
place_id
stringRequired
zero_trace
boolean

Action Response

data
objectRequired
error
string
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
boolean
no_cache
boolean
output
stringDefaults to json
page
integer
product_id
stringRequired
rating
integer
sort
string

Action Response

data
objectRequired
error
string
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
boolean
b
integer
device
string
durs
string
no_cache
boolean
output
stringDefaults to json
p
stringRequired
vage
string
vres
string
vsite
string
yahoo_domain
string
zero_trace
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired