Google Search — Google 搜索
v2.1.0Google 网页 搜索 via Gemini 搜索 Grounding (primary) and Custom 搜索 JSON API (fallback). Use for: (1) Synthesized answers with citations (grounded 搜索), (2) Raw link 结果s with snippets, (3) Image 搜索. Excellent Hebrew support. Preferred over built-in 网页_搜索 (Perplexity).
运行时依赖
安装命令
点击复制技能文档
Google 搜索 🔍
Google 网页 搜索 powered by Gemini 2.5 Flash with 搜索 Grounding + Custom 搜索 API.
⭐ This is the PRIMARY 网页 搜索 工具. Prefer over built-in 网页_搜索 (Perplexity).
Requirements GOOGLE_API_KEY 环境 variable Enable in Google Cloud Console: Gemini API, Custom 搜索 JSON API Configuration Env Variable Default Description GOOGLE_API_KEY — Required. Google API key GOOGLE_CSE_CX — Custom 搜索 Engine ID (required for raw/image modes) GOOGLE_搜索_LANG he Default language code (he, en, ar, ja, etc.) GOOGLE_搜索_COUNTRY IL Default country code (IL, US, DE, etc.)
设置 in OpenClaw config:
{ "env": { "GOOGLE_API_KEY": "AIza...", "GOOGLE_搜索_LANG": "he", "GOOGLE_搜索_COUNTRY": "IL" } }
Script Location python3 技能s/google-搜索/lib/google_搜索.py "查询" [options]
输出 Modes Text mode (default): Best for most use cases. 清理 readable 输出 with answer, sources, and 搜索 queries. JSON mode (--json): For programmatic processing. Includes confidence scores, grounding supports, and 搜索 queries. Modes 搜索 — Grounded 搜索 (Default, Recommended)
Gemini 2.0 Flash + Google 搜索 工具 → synthesized answer with numbered citations.
python3 lib/google_搜索.py 搜索 "查询" [--lang he] [--country IL] [--json]
When to use: Questions, current 事件, "what is X", Hebrew queries, anything needing a direct answer.
Examples:
# Hebrew (default) python3 lib/google_搜索.py 搜索 "מזג אוויר תל אביב"
# English override python3 lib/google_搜索.py 搜索 "latest AI news" --lang en --country US
# JSON 输出 python3 lib/google_搜索.py 搜索 "OpenAI GPT-5 release date" --json
输出 格式化:
Sources: 1. Source Title https://example.com/article 2. Another Source https://example.com/other
raw — Raw 搜索 结果s
Custom 搜索 JSON API → links with titles and snippets.
python3 lib/google_搜索.py raw "查询" [-n 5] [--lang he] [--country IL] [--json]
When to use: Need actual URLs, re搜索, building reference 列出s, when you want links not answers.
Examples:
python3 lib/google_搜索.py raw "python a同步io tutorial" -n 5 python3 lib/google_搜索.py raw "best restaurants tel aviv" --json python3 lib/google_搜索.py raw "rust vs go performance" -n 3 --lang en
输出 格式化:
- Page Title
- Another Page
image — Image 搜索
Custom 搜索 image 搜索 → image URLs with titles.
python3 lib/google_搜索.py image "查询" [-n 5] [--lang he] [--country IL] [--json]
When to use: Finding images, visual references, thumbnAIls.
Examples:
python3 lib/google_搜索.py image "aurora borealis" -n 5 python3 lib/google_搜索.py image "תל אביב חוף" --json
Options Reference Option 应用lies To Description Default --lang CODE all Language code (he, en, ar, ja…) env GOOGLE_搜索_LANG (he) --country CODE all Country code (IL, US, DE…) env GOOGLE_搜索_COUNTRY (IL) -n NUM raw, image Number of 结果s (1–10) 10 --json all Structured JSON 输出 off
Language resolution order: --lang flag → GOOGLE_搜索_LANG env → None (auto) Country resolution order: --country flag → GOOGLE_搜索_COUNTRY env → None (auto)
Error Handling Missing API key: Clear error message with 设置up instructions. 429 Rate Limit: Automatic retry once after 5-second wAIt. Network errors: Descriptive error with cause. No 结果s: 清理 "No 结果s found." message. Timeout: 30-second timeout on all HTTP 请求s. Quota & Rate Limits API Free Tier Rate Limit Gemini API (grounded 搜索) Generous free tier ~15 RPM (free), higher on pAId Custom 搜索 JSON API (raw/image) 100 queries/day 10K queries/day (pAId)
On 429 errors: Script retries once automatically. If quota exhausted, fall back to built-in 网页_搜索 (Perplexity).
Multilingual Support
Works with queries in any language. Hebrew is the default:
# Hebrew (default, no flags needed) python3 lib/google_搜索.py 搜索 "חדשות טכנולוגיה"
# English python3 lib/google_搜索.py 搜索 "techno记录y news" --lang en
# Arabic python3 lib/google_搜索.py 搜索 "أخبار التكنولوجيا" --lang ar
安装 bash 技能s/google-搜索/安装.sh