简介
一站式聚合搜索API,通过单一密钥访问Google、Amazon、Yelp等20+主流平台的结构化数据,适合电商比价、本地商户调研及新闻资讯抓取。
原始描述
Unified search API across Google, Amazon, Yelp, OpenTable, Walmart, and more. Use when searching for products, local businesses, restaurants, shopping, images, news, or any web search. One API key, many engines.
通过你的 Agent 添加
安装目录:serpapi/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
SerpAPI 是一款商业级聚合搜索 API,通过统一的接口调用 20+ 主流搜索引擎(Google、Amazon、Yelp、OpenTable、Walmart、eBay、TripAdvisor 等),将原本分散在各平台的搜索能力整合为标准化 JSON 输出。
调用方式:通过 serp.py 脚本指定引擎类型、查询词及可选参数(位置、结果数量、输出格式、语言区域等)。支持通用网页搜索(google)、本地商户(google_maps/yelp)、电商比价(google_shopping/amazon/walmart)、新闻(google_news)、图片(google_images)等多维度场景。
输出特性:默认返回完整结构化 JSON,包含原始网页解析后的字段(如商户评分、GPS 坐标、商品价格、Prime 状态、知识图谱实体等);--format text 模式可快速生成人类可读摘要。
显著优点
- 多引擎覆盖:单一 API Key 替代多个平台独立接入,显著降低集成成本
- 数据结构化:自动解析 HTML,返回标准化字段,免去爬虫维护与反爬对抗
- 地理位置智能:支持邮编、城市名、完整地址,自动适配本地搜索结果
- 电商场景深度:Google Shopping 跨平台比价、Amazon Prime 标识、Walmart 库存状态等专业字段
- 免费起步:100 次/月免费额度,适合低频验证与原型开发
潜在局限与风险
- 成本门槛:高频调用(>100 次/月)需付费订阅,商业级用量成本累积显著
- 数据依赖:完全依赖第三方平台页面结构,若目标站点改版可能导致字段缺失
- 区域合规:抓取 Google/Yelp 等平台数据需遵守各平台服务条款,存在法律灰色地带
- 无实时推送:仅支持按需拉取,无 Webhook 或流式更新机制
适合人群
- 需要快速搭建比价、商户调研、新闻监控等数据应用的开发者
- 无爬虫 infrastructure 但需结构化搜索数据的中小企业
- 本地化服务类应用(餐饮推荐、房产中介、旅游攻略)的产品团队
常规风险
- API Key 泄露:密钥泄露可导致账户被盗用产生费用,需严格环境变量管理
- ** rate limit 超限**:免费 tier 无缓冲机制,突发流量易触发封禁
- 数据准确性:解析结果受目标站点 A/B 测试或反爬策略影响,需校验关键字段
- 成本门槛:高频调用(>100 次/月)需付费订阅,商业级用量成本累积显著
- 数据依赖:完全依赖第三方平台页面结构,若目标站点改版可能导致字段缺失
- 区域合规:抓取 Google/Yelp 等平台数据需遵守各平台服务条款,存在法律灰色地带
- 无实时推送:仅支持按需拉取,无 Webhook 或流式更新机制
适合人群
- 需要快速搭建比价、商户调研、新闻监控等数据应用的开发者
- 无爬虫 infrastructure 但需结构化搜索数据的中小企业
- 本地化服务类应用(餐饮推荐、房产中介、旅游攻略)的产品团队
常规风险
- API Key 泄露:密钥泄露可导致账户被盗用产生费用,需严格环境变量管理
- ** rate limit 超限**:免费 tier 无缓冲机制,突发流量易触发封禁
- 数据准确性:解析结果受目标站点 A/B 测试或反爬策略影响,需校验关键字段
- API Key 泄露:密钥泄露可导致账户被盗用产生费用,需严格环境变量管理
- ** rate limit 超限**:免费 tier 无缓冲机制,突发流量易触发封禁
- 数据准确性:解析结果受目标站点 A/B 测试或反爬策略影响,需校验关键字段
技能正文
name: serpapi
description: Unified search API across Google, Amazon, Yelp, OpenTable, Walmart, and more. Use when searching for products, local businesses, restaurants, shopping, images, news, or any web search. One API key, many engines.
homepage: https://serpapi.com
metadata: {"clawdbot":{"emoji":"🔍","requires":{"env":["SERPAPI_API_KEY"]}}}
SerpAPI - Unified Search
SerpAPI provides structured data from Google, Amazon, Yelp, OpenTable, and 20+ other search engines through a single API.
Setup
- Get an API key from https://serpapi.com (free tier: 100 searches/month)
- Set environment variable:
export SERPAPI_API_KEY=your-key-here
- Optionally set default location in
<workspace>/TOOLS.md:
## SerpAPI
Default location: Pittsburgh, PA
Usage
# General syntax
<skill>/scripts/serp.py <engine> "<query>" [options]
# Examples
serp.py google "best coffee shops"
serp.py google_maps "restaurants near me" --location "15238"
serp.py amazon "mechanical keyboard" --num 10
serp.py yelp "pizza" --location "New York, NY"
serp.py google_shopping "standing desk"
Engines
Engine
Use for
Key features
google
General web search
Organic results, knowledge graph, local pack
google_maps
Local places/businesses
Ratings, reviews, hours, GPS coordinates
google_shopping
Product search
Prices, merchants, reviews
google_images
Image search
Thumbnails, sources
google_news
News articles
Headlines, sources, dates
amazon
Amazon products
Prices, ratings, reviews, Prime status
yelp
Local businesses
Reviews, ratings, categories
opentable
Restaurant reviews
Dining reviews, ratings
walmart
Walmart products
Prices, availability
ebay
eBay listings
Prices, bids, conditions
tripadvisor
Travel/attractions
Hotels, restaurants, things to do
Options
Option
Description
--location, -l
Location for local results (city, zip, address)
--num, -n
Number of results (default: 10)
--format, -f
Output format: json (default) or text
--type, -t
Google search type: shop, isch, nws, vid
--page, -p
Page number for pagination
--gl
Country code (e.g., us, uk, de)
--hl
Language code (e.g., en, es, fr)
When to Use Which Engine
export SERPAPI_API_KEY=your-key-here<workspace>/TOOLS.md:
## SerpAPI
Default location: Pittsburgh, PA
# General syntax
<skill>/scripts/serp.py <engine> "<query>" [options]
# Examples
serp.py google "best coffee shops"
serp.py google_maps "restaurants near me" --location "15238"
serp.py amazon "mechanical keyboard" --num 10
serp.py yelp "pizza" --location "New York, NY"
serp.py google_shopping "standing desk"
Engines
Engine
Use for
Key features
google
General web search
Organic results, knowledge graph, local pack
google_maps
Local places/businesses
Ratings, reviews, hours, GPS coordinates
google_shopping
Product search
Prices, merchants, reviews
google_images
Image search
Thumbnails, sources
google_news
News articles
Headlines, sources, dates
amazon
Amazon products
Prices, ratings, reviews, Prime status
yelp
Local businesses
Reviews, ratings, categories
opentable
Restaurant reviews
Dining reviews, ratings
walmart
Walmart products
Prices, availability
ebay
eBay listings
Prices, bids, conditions
tripadvisor
Travel/attractions
Hotels, restaurants, things to do
Options
Option
Description
--location, -l
Location for local results (city, zip, address)
--num, -n
Number of results (default: 10)
--format, -f
Output format: json (default) or text
--type, -t
Google search type: shop, isch, nws, vid
--page, -p
Page number for pagination
--gl
Country code (e.g., us, uk, de)
--hl
Language code (e.g., en, es, fr)
When to Use Which Engine
| Engine | Use for | Key features |
|---|---|---|
google |
General web search | Organic results, knowledge graph, local pack |
google_maps |
Local places/businesses | Ratings, reviews, hours, GPS coordinates |
google_shopping |
Product search | Prices, merchants, reviews |
google_images |
Image search | Thumbnails, sources |
google_news |
News articles | Headlines, sources, dates |
amazon |
Amazon products | Prices, ratings, reviews, Prime status |
yelp |
Local businesses | Reviews, ratings, categories |
opentable |
Restaurant reviews | Dining reviews, ratings |
walmart |
Walmart products | Prices, availability |
ebay |
eBay listings | Prices, bids, conditions |
tripadvisor |
Travel/attractions | Hotels, restaurants, things to do |
| Option | Description |
|---|---|
--location, -l |
Location for local results (city, zip, address) |
--num, -n |
Number of results (default: 10) |
--format, -f |
Output format: json (default) or text |
--type, -t |
Google search type: shop, isch, nws, vid |
--page, -p |
Page number for pagination |
--gl |
Country code (e.g., us, uk, de) |
--hl |
Language code (e.g., en, es, fr) |
When to Use Which Engine
Finding local businesses/restaurants:
google_maps— Best for discovering places, hours, reviewsyelp— Deep reviews and ratings for restaurants/servicesopentable— Restaurant-specific, dining reviews
Shopping/Products:
google_shopping— Compare prices across merchantsamazon— Amazon-specific search with Prime infowalmart— Walmart inventory and pricesebay— Used items, auctions, collectibles
General research:
google— Web pages, articles, general infogoogle_news— Current events, news articlesgoogle_images— Finding images
Examples
Find restaurants near a location
serp.py google_maps "italian restaurants" --location "Pittsburgh, PA" --num 5
Compare product prices
serp.py google_shopping "sony wh-1000xm5" --num 10
Check Amazon reviews and pricing
serp.py amazon "standing desk" --num 10
Get Yelp reviews for local services
serp.py yelp "plumber" --location "15238"
Search news on a topic
serp.py google_news "AI regulation" --num 5
Output Formats
serp.py google_shopping "sony wh-1000xm5" --num 10
serp.py amazon "standing desk" --num 10
Get Yelp reviews for local services
serp.py yelp "plumber" --location "15238"
Search news on a topic
serp.py google_news "AI regulation" --num 5
Output Formats
serp.py yelp "plumber" --location "15238"
serp.py google_news "AI regulation" --num 5
Output Formats
JSON (default): Full structured data from SerpAPI. Best for programmatic use or when you need all details.
Text (--format text): Human-readable summary. Best for quick answers.
Integration Notes
- Results are structured JSON — parse and extract what you need
- Local results include GPS coordinates for mapping
- Shopping results include extracted prices for comparison
- Knowledge graph provides entity information when available
- Rate limits: 100/month on free tier, check your plan at serpapi.com/dashboard
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。