SerpAPI Search
Search Google via SerpAPI with country/language targeting.
Quick start
# Google Search
{baseDir}/scripts/search.sh "artificial intelligence B2B" --country br --lang pt
# Google News
{baseDir}/scripts/search.sh "inteligência artificial" --engine google_news --country br --lang pt
# Google Local
{baseDir}/scripts/search.sh "AI companies" --engine google_local --country us --location "San Francisco, California"
Engines
| Engine |
Use case |
Key results field |
google |
Web search (default) |
organic_results |
google_news |
News articles |
news_results |
google_local |
Local businesses/places |
local_results |
Options
| Flag |
Description |
Default |
--engine |
google, google_news, google_local |
google |
--country |
2-letter country code (br, us, de, etc.) |
us |
--lang |
Language code (pt, en, es, etc.) |
en |
--location |
Location string (e.g. "São Paulo, Brazil") |
— |
--num |
Number of results |
10 |
--json |
Raw JSON output |
off |
API key
Set SERPAPI_API_KEY env var, or store it:
mkdir -p ~/.config/serpapi
echo "your_key_here" > ~/.config/serpapi/api_key
chmod 600 ~/.config/serpapi/api_key
Common country codes
br (Brazil), us (USA), pt (Portugal), de (Germany), fr (France), es (Spain), gb (UK), jp (Japan), in (India).
1---
2name: serpapi-2
3description: Search Google via SerpAPI (Google Search, Google News, Google Local). Use when you need to search the web, find news articles, or look up local businesses. Supports country/language targeting for region-specific results.
4metadata: {"clawdbot":{"emoji":"🔍","requires":{"bins":["curl","python3"],"env":["SERPAPI_API_KEY"]},"primaryEnv":"SERPAPI_API_KEY"}}
5---
6
7# SerpAPI Search
8
9Search Google via SerpAPI with country/language targeting.
10
11## Quick start
12
13```bash
14# Google Search
15{baseDir}/scripts/search.sh "artificial intelligence B2B" --country br --lang pt
16
17# Google News
18{baseDir}/scripts/search.sh "inteligência artificial" --engine google_news --country br --lang pt
19
20# Google Local
21{baseDir}/scripts/search.sh "AI companies" --engine google_local --country us --location "San Francisco, California"
22```
23
24## Engines
25
26| Engine | Use case | Key results field |
27|--------|----------|-------------------|
28| `google` | Web search (default) | `organic_results` |
29| `google_news` | News articles | `news_results` |
30| `google_local` | Local businesses/places | `local_results` |
31
32## Options
33
34| Flag | Description | Default |
35|------|-------------|---------|
36| `--engine` | `google`, `google_news`, `google_local` | `google` |
37| `--country` | 2-letter country code (`br`, `us`, `de`, etc.) | `us` |
38| `--lang` | Language code (`pt`, `en`, `es`, etc.) | `en` |
39| `--location` | Location string (e.g. `"São Paulo, Brazil"`) | — |
40| `--num` | Number of results | `10` |
41| `--json` | Raw JSON output | off |
42
43## API key
44
45Set `SERPAPI_API_KEY` env var, or store it:
46```bash
47mkdir -p ~/.config/serpapi
48echo "your_key_here" > ~/.config/serpapi/api_key
49chmod 600 ~/.config/serpapi/api_key
50```
51
52## Common country codes
53
54`br` (Brazil), `us` (USA), `pt` (Portugal), `de` (Germany), `fr` (France), `es` (Spain), `gb` (UK), `jp` (Japan), `in` (India).