360 Secure SkillHub
360 安全技能中心

Google Search (Serper.dev)

这是基于Serper.dev API的谷歌搜索工具,支持网页、新闻、图片等9类搜索,返回知识图谱、问答框等丰富结果。适用于用户需谷歌搜索、获取当前资讯、查找学术论文/本地场所,或Brave搜索结果不足时。通过命令行调用,可指定搜索类型、数量、时间范围等参数,输出支持格式化文本或JSON,需配置免费Serper.dev API密钥,购物搜索额外消耗1 credit。

minilozio
minilozio
热度 73.19
最近更新 2026-05-11 17:27:36
分类:搜索依赖:代码执行 / 第三方 API应用场景:研究 / news / 购物

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add google-search-serper
Metadata
name
google-search-serper
description
Google Search powered by Serper.dev API — 9 search types: web, news, images, videos, places, shopping, scholar, patents, autocomplete. Returns Knowledge Graph, Answer Box, People Also Ask, and Related Searches. Use when asked to Google something, search the web for current info, find news, look up images, research academic papers, find local places, or when the user needs richer search results than basic web search. Also use when Brave Search results are insufficient or the user explicitly wants Google results.

Google Search Skill

Google Search powered by Serper.dev API. Replaces Brave Search with richer results including Knowledge Graph, Answer Box, People Also Ask, and specialized search types.

When to Use

Use this skill for any Google search request. Auto-detect intent:

  • Default → search
  • "news about X" / "latest X" → news
  • "images of X" / "pictures of X" → images
  • "videos of X" / "how to X video" → videos
  • "restaurants near X" / "X near me" → places
  • "how much does X cost" / "buy X" → shopping (⚠️ 2 credits — only when explicitly requested)
  • "papers on X" / "research about X" → scholar
  • "patents for X" → patents
  • "suggestions for X" → suggest

Usage

SCRIPT_DIR="~/.openclaw/workspace/skills/google-search/scripts"

# Web search (default)
npx tsx $SCRIPT_DIR/google-search.ts search "query" [--num 10] [--time day|week|month|year] [--country us] [--lang en]

# Specialized
npx tsx $SCRIPT_DIR/google-search.ts news "query" [--num 10]
npx tsx $SCRIPT_DIR/google-search.ts images "query"
npx tsx $SCRIPT_DIR/google-search.ts videos "query"
npx tsx $SCRIPT_DIR/google-search.ts places "query"
npx tsx $SCRIPT_DIR/google-search.ts shopping "query"
npx tsx $SCRIPT_DIR/google-search.ts scholar "query" [--year 2023]
npx tsx $SCRIPT_DIR/google-search.ts patents "query"
npx tsx $SCRIPT_DIR/google-search.ts suggest "query"
npx tsx $SCRIPT_DIR/google-search.ts credits

Add --json to any command for raw JSON output.

Setup

Requires a free API key from Serper.dev:

  1. Sign up at https://serper.dev (2,500 free searches included)
  2. Copy your API key from the dashboard
  3. Add to your environment: export SERPER_API_KEY=your_key_here

If the key is missing, remind the user to sign up at serper.dev — it's free and takes 30 seconds.

Workflow

  1. Run the appropriate search command
  2. Parse the formatted output
  3. If deeper content is needed, use web_fetch on promising links
  4. Credit balance is shown in every response — monitor usage
  5. Shopping costs 2 credits — only use when user explicitly asks for prices/shopping

Time Filters

--time accepts: hour, day, week, month, year (or h, d, w, m, y)

Notes

  • Rate limit: 5 req/sec on free tier
  • All searches cost 1 credit except shopping (2 credits)
  • Results include rich data: Knowledge Graph, Answer Box, People Also Ask, Related Searches