SerpAPI - Unified Search
SerpAPI provides structured data from Google, Amazon, Yelp, OpenTable, and 20+ other search engines through a single API.
Setup
- Get an API key from https://serpapi.com (free tier: 100 searches/month)
- Set environment variable:
export SERPAPI_API_KEY=your-key-here
- Optionally set default location in
<workspace>/TOOLS.md:## SerpAPI
Default location: Pittsburgh, PA
Usage
# General syntax
<skill>/scripts/serp.py <engine> "<query>" [options]
# Examples
serp.py google "best coffee shops"
serp.py google_maps "restaurants near me" --location "15238"
serp.py amazon "mechanical keyboard" --num 10
serp.py yelp "pizza" --location "New York, NY"
serp.py google_shopping "standing desk"
Engines
| Engine |
Use for |
Key features |
google |
General web search |
Organic results, knowledge graph, local pack |
google_maps |
Local places/businesses |
Ratings, reviews, hours, GPS coordinates |
google_shopping |
Product search |
Prices, merchants, reviews |
google_images |
Image search |
Thumbnails, sources |
google_news |
News articles |
Headlines, sources, dates |
amazon |
Amazon products |
Prices, ratings, reviews, Prime status |
yelp |
Local businesses |
Reviews, ratings, categories |
opentable |
Restaurant reviews |
Dining reviews, ratings |
walmart |
Walmart products |
Prices, availability |
ebay |
eBay listings |
Prices, bids, conditions |
tripadvisor |
Travel/attractions |
Hotels, restaurants, things to do |
Options
| Option |
Description |
--location, -l |
Location for local results (city, zip, address) |
--num, -n |
Number of results (default: 10) |
--format, -f |
Output format: json (default) or text |
--type, -t |
Google search type: shop, isch, nws, vid |
--page, -p |
Page number for pagination |
--gl |
Country code (e.g., us, uk, de) |
--hl |
Language code (e.g., en, es, fr) |
When to Use Which Engine
Finding local businesses/restaurants:
google_maps — Best for discovering places, hours, reviews
yelp — Deep reviews and ratings for restaurants/services
opentable — Restaurant-specific, dining reviews
Shopping/Products:
google_shopping — Compare prices across merchants
amazon — Amazon-specific search with Prime info
walmart — Walmart inventory and prices
ebay — Used items, auctions, collectibles
General research:
google — Web pages, articles, general info
google_news — Current events, news articles
google_images — Finding images
Examples
Find restaurants near a location
serp.py google_maps "italian restaurants" --location "Pittsburgh, PA" --num 5
Compare product prices
serp.py google_shopping "sony wh-1000xm5" --num 10
Check Amazon reviews and pricing
serp.py amazon "standing desk" --num 10
Get Yelp reviews for local services
serp.py yelp "plumber" --location "15238"
Search news on a topic
serp.py google_news "AI regulation" --num 5
Output Formats
JSON (default): Full structured data from SerpAPI. Best for programmatic use or when you need all details.
Text (--format text): Human-readable summary. Best for quick answers.
Integration Notes
- Results are structured JSON — parse and extract what you need
- Local results include GPS coordinates for mapping
- Shopping results include extracted prices for comparison
- Knowledge graph provides entity information when available
- Rate limits: 100/month on free tier, check your plan at serpapi.com/dashboard
1---
2name: serpapi
3description: Unified search API across Google, Amazon, Yelp, OpenTable, Walmart, and more. Use when searching for products, local businesses, restaurants, shopping, images, news, or any web search. One API key, many engines.
4homepage: https://serpapi.com
5metadata:
6 source: https://skillmd.com/skills/modbender/serpapi
7 clawdbot:
8 emoji: 🔍
9 requires:
10 env:
11 - SERPAPI_API_KEY
12---
13
14# SerpAPI - Unified Search
15
16SerpAPI provides structured data from Google, Amazon, Yelp, OpenTable, and 20+ other search engines through a single API.
17
18## Setup
19
201. Get an API key from https://serpapi.com (free tier: 100 searches/month)
212. Set environment variable: `export SERPAPI_API_KEY=your-key-here`
223. Optionally set default location in `<workspace>/TOOLS.md`:
23 ```markdown
24 ## SerpAPI
25 Default location: Pittsburgh, PA
26 ```
27
28## Usage
29
30```bash
31# General syntax
32<skill>/scripts/serp.py <engine> "<query>" [options]
33
34# Examples
35serp.py google "best coffee shops"
36serp.py google_maps "restaurants near me" --location "15238"
37serp.py amazon "mechanical keyboard" --num 10
38serp.py yelp "pizza" --location "New York, NY"
39serp.py google_shopping "standing desk"
40```
41
42## Engines
43
44| Engine | Use for | Key features |
45|--------|---------|--------------|
46| `google` | General web search | Organic results, knowledge graph, local pack |
47| `google_maps` | Local places/businesses | Ratings, reviews, hours, GPS coordinates |
48| `google_shopping` | Product search | Prices, merchants, reviews |
49| `google_images` | Image search | Thumbnails, sources |
50| `google_news` | News articles | Headlines, sources, dates |
51| `amazon` | Amazon products | Prices, ratings, reviews, Prime status |
52| `yelp` | Local businesses | Reviews, ratings, categories |
53| `opentable` | Restaurant reviews | Dining reviews, ratings |
54| `walmart` | Walmart products | Prices, availability |
55| `ebay` | eBay listings | Prices, bids, conditions |
56| `tripadvisor` | Travel/attractions | Hotels, restaurants, things to do |
57
58## Options
59
60| Option | Description |
61|--------|-------------|
62| `--location`, `-l` | Location for local results (city, zip, address) |
63| `--num`, `-n` | Number of results (default: 10) |
64| `--format`, `-f` | Output format: `json` (default) or `text` |
65| `--type`, `-t` | Google search type: `shop`, `isch`, `nws`, `vid` |
66| `--page`, `-p` | Page number for pagination |
67| `--gl` | Country code (e.g., `us`, `uk`, `de`) |
68| `--hl` | Language code (e.g., `en`, `es`, `fr`) |
69
70## When to Use Which Engine
71
72**Finding local businesses/restaurants:**
73- `google_maps` — Best for discovering places, hours, reviews
74- `yelp` — Deep reviews and ratings for restaurants/services
75- `opentable` — Restaurant-specific, dining reviews
76
77**Shopping/Products:**
78- `google_shopping` — Compare prices across merchants
79- `amazon` — Amazon-specific search with Prime info
80- `walmart` — Walmart inventory and prices
81- `ebay` — Used items, auctions, collectibles
82
83**General research:**
84- `google` — Web pages, articles, general info
85- `google_news` — Current events, news articles
86- `google_images` — Finding images
87
88## Examples
89
90### Find restaurants near a location
91```bash
92serp.py google_maps "italian restaurants" --location "Pittsburgh, PA" --num 5
93```
94
95### Compare product prices
96```bash
97serp.py google_shopping "sony wh-1000xm5" --num 10
98```
99
100### Check Amazon reviews and pricing
101```bash
102serp.py amazon "standing desk" --num 10
103```
104
105### Get Yelp reviews for local services
106```bash
107serp.py yelp "plumber" --location "15238"
108```
109
110### Search news on a topic
111```bash
112serp.py google_news "AI regulation" --num 5
113```
114
115## Output Formats
116
117**JSON (default):** Full structured data from SerpAPI. Best for programmatic use or when you need all details.
118
119**Text (`--format text`):** Human-readable summary. Best for quick answers.
120
121## Integration Notes
122
123- Results are structured JSON — parse and extract what you need
124- Local results include GPS coordinates for mapping
125- Shopping results include extracted prices for comparison
126- Knowledge graph provides entity information when available
127- Rate limits: 100/month on free tier, check your plan at serpapi.com/dashboard