SerpAPI Search 是一个基于 SerpAPI 的 Google 搜索技能,提供网页搜索、新闻搜索和本地商家搜索三类能力,并支持国家与语言定向。
用途 该技能用于在需要联网搜索时调用 Google 搜索,包括查找网页内容、检索新闻文章,以及查询本地商家或地点信息。
主要能力 支持三种引擎:google(网页搜索,默认)、google_news(新闻文章)、google_local(本地商家/地点)。不同引擎返回的关键结果字段不同:google 对应 organic_results,google_news 对应 news_results,google_local 对应 local_results。
使用方式 通过脚本 {baseDir}/scripts/search.sh 调用,示例:
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"
可用选项:
- --engine:可选 google、google_news、google_local,默认 google
- --country:两位国家代码(如 br、us、de),默认 us
- --lang:语言代码(如 pt、en、es),默认 en
- --location:位置字符串(如 "São Paulo, Brazil"),默认未提供
- --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(印度)。
适用场景 需要联网搜索网页、查找新闻文章,或查询本地商家信息时使用。
限制 资料未提供该技能的收费、价格、平台支持范围、效果保证或更多使用步骤,相关事实暂未提供。