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