← 返回
内容创作 Key 中文

Google Search Grounding 3

Google web search via Gemini Search Grounding (primary) and Custom Search JSON API (fallback). Use for: (1) Synthesized answers with citations (grounded search), (2) Raw link results with snippets, (3) Image search. Excellent Hebrew support. Preferred over built-in web_search (Perplexity).
通过 Gemini 搜索落地(主)和 Custom Search JSON API(备)进行 Google 网页搜索。用途:(1) 附引用的综合回答(落地搜索),(2) 含摘要的原始链接结果,(3) 图片搜索。希伯来语支持极佳。优于内置 web_search (Perplexity)。
phucanh08
内容创作 clawhub v1.0.0 1 版本 99910.6 Key: 需要
★ 0
Stars
📥 1,118
下载
💾 112
安装
1
版本
#latest

概述

Google Search 🔍

Google web search powered by Gemini 2.5 Flash with Search Grounding + Custom Search API.

⭐ This is the PRIMARY web search tool. Prefer over built-in web_search (Perplexity).

Requirements

  • GOOGLE_API_KEY environment variable
  • Enable in Google Cloud Console: Gemini API, Custom Search JSON API

Configuration

Env VariableDefaultDescription
---------
GOOGLE_API_KEYRequired. Google API key
GOOGLE_CSE_CXCustom Search Engine ID (required for raw/image modes)
GOOGLE_SEARCH_LANGheDefault language code (he, en, ar, ja, etc.)
GOOGLE_SEARCH_COUNTRYILDefault country code (IL, US, DE, etc.)

Set in OpenClaw config:

{
  "env": {
    "GOOGLE_API_KEY": "AIza...",
    "GOOGLE_SEARCH_LANG": "he",
    "GOOGLE_SEARCH_COUNTRY": "IL"
  }
}

Script Location

python3 skills/google-search/lib/google_search.py <mode> "query" [options]

Output Modes

  • Text mode (default): Best for most use cases. Clean readable output with answer, sources, and search queries.
  • JSON mode (--json): For programmatic processing. Includes confidence scores, grounding supports, and search queries.

Modes

search — Grounded Search (Default, Recommended)

Gemini 2.0 Flash + Google Search tool → synthesized answer with numbered citations.

python3 lib/google_search.py search "query" [--lang he] [--country IL] [--json]

When to use: Questions, current events, "what is X", Hebrew queries, anything needing a direct answer.

Examples:

# Hebrew (default)
python3 lib/google_search.py search "מזג אוויר תל אביב"

# English override
python3 lib/google_search.py search "latest AI news" --lang en --country US

# JSON output
python3 lib/google_search.py search "OpenAI GPT-5 release date" --json

Output format:

<Synthesized answer text>

Sources:
  1. Source Title
     https://example.com/article
  2. Another Source
     https://example.com/other

raw — Raw Search Results

Custom Search JSON API → links with titles and snippets.

python3 lib/google_search.py raw "query" [-n 5] [--lang he] [--country IL] [--json]

When to use: Need actual URLs, research, building reference lists, when you want links not answers.

Examples:

python3 lib/google_search.py raw "python asyncio tutorial" -n 5
python3 lib/google_search.py raw "best restaurants tel aviv" --json
python3 lib/google_search.py raw "rust vs go performance" -n 3 --lang en

Output format:

1. Page Title
   https://example.com/page
   Brief snippet from the page...

2. Another Page
   https://example.com/other
   Another snippet...

image — Image Search

Custom Search image search → image URLs with titles.

python3 lib/google_search.py image "query" [-n 5] [--lang he] [--country IL] [--json]

When to use: Finding images, visual references, thumbnails.

Examples:

python3 lib/google_search.py image "aurora borealis" -n 5
python3 lib/google_search.py image "תל אביב חוף" --json

Options Reference

OptionApplies ToDescriptionDefault
------------
--lang CODEallLanguage code (he, en, ar, ja…)env GOOGLE_SEARCH_LANG (he)
--country CODEallCountry code (IL, US, DE…)env GOOGLE_SEARCH_COUNTRY (IL)
-n NUMraw, imageNumber of results (1–10)10
--jsonallStructured JSON outputoff

Language resolution order: --lang flag → GOOGLE_SEARCH_LANG env → None (auto)

Country resolution order: --country flag → GOOGLE_SEARCH_COUNTRY env → None (auto)


Error Handling

  • Missing API key: Clear error message with setup instructions.
  • 429 Rate Limit: Automatic retry once after 5-second wait.
  • Network errors: Descriptive error with cause.
  • No results: Clean "No results found." message.
  • Timeout: 30-second timeout on all HTTP requests.

Quota & Rate Limits

APIFree TierRate Limit
---------
Gemini API (grounded search)Generous free tier~15 RPM (free), higher on paid
Custom Search JSON API (raw/image)100 queries/day10K queries/day (paid)

On 429 errors: Script retries once automatically. If quota exhausted, fall back to built-in web_search (Perplexity).


Multilingual Support

Works with queries in any language. Hebrew is the default:

# Hebrew (default, no flags needed)
python3 lib/google_search.py search "חדשות טכנולוגיה"

# English
python3 lib/google_search.py search "technology news" --lang en

# Arabic
python3 lib/google_search.py search "أخبار التكنولوجيا" --lang ar

Install

bash skills/google-search/install.sh

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 01:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,247
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 862 📥 200,233
developer-tools

Codex Sub Agents 1

phucanh08
使用 OpenAI Codex CLI 处理编码任务。触发词:codex、code review、fix CI、refactor code、implement feature、coding agent、gpt-5-codex。Clawdbo
★ 0 📥 1,770