返回 Skill 列表
extension
分类: 开发与工程需要 API Key

SerpAPI Search

通过 SerpAPI 搜索 Google(涵盖网页、新闻、本地服务)。适用于联网搜索、查找新闻或查询本地商家。支持按国家/语言定位以获取特定区域的结果。

person作者: ericsantoshubclawhub

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).