360 Secure SkillHub
360 安全技能中心

WebSearch with SerpApi

基于 Python 脚本调用 SerpAPI 执行网络搜索,支持 google、google_ai_mode、google_images、google_maps、youtube 等引擎,需配置 SerpAPI 密钥,搜索结果以文本块形式返回。

lsl001006
lsl001006
热度 67.54
最近更新 2026-05-11 17:27:08
分类:搜索依赖:代码执行 / 第三方 API应用场景:研究

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add web-search-with-serpapi
Metadata
name
serpapi-search
description
Search the web using SerpAPI with customizable engines (Google, Google AI Mode, Bing, etc.). Use when user needs web search results via SerpAPI.
metadata
{"openclaw":{"requires":{"python":true,"pip":["serpapi"]},"entrypoint":"serpapi_search.py"}}

SerpAPI Search Skill

Description

Use SerpAPI to fetch search results with support for multiple engines (Google, Google AI Mode, Bing, Yahoo, etc.). Requires a SerpAPI key.

Parameters

  • query (required): Search query string.
  • engine (optional): Search engine (default: google). Options: google, google_ai_mode, google_images, google_maps, youtube

Example Usage

# Search with Google
serpapi_search(query="2026年2月24日A股市场表现", engine="google")

# Use Google AI Mode
serpapi_search(query="AI最新进展", engine="google_ai_mode")

# Use Google Image for image search
serpapi_search(query="Sunflowers", engine="google_images")

Setup

  1. Replace the API key in serpapi_search.py with your SerpAPI key.
  2. Install dependencies: pip install serpapi

Notes

  • Results are returned as text blocks from SerpAPI response.
  • API key can be set via environment variable SERPAPI_API_KEY for security.