SerpAPI Search
2026-03-30
新闻来源:网淘吧
围观:10
电脑广告
手机广告
SerpAPI 搜索
通过 SerpAPI 进行支持国家/语言定向的谷歌搜索。
快速开始
# 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"
引擎
| 引擎 | 使用场景 | 关键结果字段 |
|---|---|---|
google | 网页搜索(默认) | organic_results |
google_news | 新闻文章 | news_results |
google_local | 本地商家/地点 | local_results |
选项
| 标志 | 描述 | 默认值 |
|---|---|---|
--engine | google,google_news,google_local | 谷歌 |
--country | 两位字母国家代码(br、us、de等) | us |
--lang | 语言代码(pt、en、es等) | en |
--location | 位置字符串(例如"巴西,圣保罗") | — |
--num | 结果数量 | 10 |
--json | 原始JSON输出 | 关闭 |
API密钥
设置SERPAPI_API_KEY环境变量,或存储它:

mkdir -p ~/.config/serpapi
echo "your_key_here" > ~/.config/serpapi/api_key
chmod 600 ~/.config/serpapi/api_key
常见国家代码
br(巴西),us(美国),pt(葡萄牙),de(德国),fr(法国),es(西班牙),gb(英国),jp(日本),in(印度)。
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~