Pangolinfo AI SERP Skill
Google AI Mode search and standard SERP extraction with AI Overview and citations via Pangolin APIs.
When to Use This Skill
Triggers: Google SERP scraping, AI Overview extraction, AI Mode search, Google citation extraction, 抓Google SERP, 谷歌AI概览, 引用来源提取
Do not use this skill for: Amazon product searches, Google Trends, Google Maps, or non-Google search engines.
Prerequisites
- - Python 3.8+ (standard library only -- no
pip install needed) - Pangolin account at pangolinfo.com
Environment Variables
Set one of:
| Variable | Option | Description |
|---|
| INLINECODE1 | A (recommended) | API Key -- skips login |
| INLINECODE2 + INLINECODE3 |
B | Account credentials |
API key resolution order: PANGOLIN_API_KEY env var > cached ~/.pangolin_api_key (if previously cached) > fresh login.
macOS SSL Fix
If you see error code SSL_CERT, run:
/Applications/Python\ 3.x/Install\ Certificates.command
Or: INLINECODE7
Script Execution
The main script is scripts/pangolin.py relative to this skill directory.
CODEBLOCK1
Intent-to-Command Mapping
AI Mode Search (default)
AI-generated answers with references. Default mode, costs 2 credits.
CODEBLOCK2
Standard SERP
Traditional Google search results + optional AI Overview. Costs 2 credits.
CODEBLOCK3
SERP Plus (cheaper)
Same as SERP but costs only 1 credit. Uses the googleSearchPlus parser.
CODEBLOCK4
SERP with Screenshot
CODEBLOCK5
SERP with Region
CODEBLOCK6
Multi-Turn Dialogue (AI Mode only)
CODEBLOCK7
Auth Check (no credits consumed)
CODEBLOCK8
All CLI Options
| Option | Type | Default | Description |
|---|
| INLINECODE10 | string | required | Search query |
| INLINECODE11 |
ai-mode \|
serp \|
serp-plus |
ai-mode | API mode |
|
--screenshot | flag | off | Capture page screenshot |
|
--follow-up | string (repeatable) | none | Follow-up question (ai-mode only) |
|
--num | int (1-100) |
10 | Number of results |
|
--region | string | none | Geographic region (SERP/SERP-Plus only). See supported regions below. |
|
--auth-only | flag | off | Auth check only (no query, no credits) |
|
--raw | flag | off | Output raw API response |
|
--timeout | int |
120 | Request timeout in seconds |
|
--cache-key | flag | off | Persist API key to
~/.pangolin_api_key. Also settable via
PANGOLIN_CACHE=1. |
Supported Regions
| Code | Language | Code | Language |
|---|
| INLINECODE28 | English | INLINECODE29 | Chinese |
| INLINECODE30 |
English |
dk | Danish |
|
au | English |
no | Norwegian |
|
ca | English |
se | Swedish |
|
nz | English |
nl | Dutch |
|
de | German |
pt | Portuguese |
|
fr | French |
es | Spanish |
|
it | Italian |
jp | Japanese |
Cost
| Mode | Credits | Parser |
|---|
| AI Mode | 2 | INLINECODE44 |
| SERP |
2 |
googleSearch |
| SERP Plus | 1 |
googleSearchPlus |
Credits are only consumed on successful requests (API code 0). Auth checks do not consume credits.
Output Format
JSON to stdout on success, structured error JSON to stderr on failure.
Success Example (AI Mode)
CODEBLOCK9
Error Example (stderr)
CODEBLOCK10
Response Presentation
- 1. Use natural language -- never dump raw JSON.
- Match the user's language.
- Summarize AI overview first, then list organic results with URLs.
- On error, explain the issue using the
hint field.
Exit Codes
API error (non-zero code from Pangolin) |
| 2 | Usage error (bad arguments) |
| 3 | Network error |
| 4 | Authentication error |
Error Reference
Script Error Codes
| Code | Meaning | Resolution |
|---|
| INLINECODE48 | No credentials | Set PANGOLIN_API_KEY, or PANGOLIN_EMAIL + INLINECODE51 |
| INLINECODE52 |
Wrong credentials | Verify email and password |
|
RATE_LIMIT | Too many requests | Wait and retry |
|
NETWORK | Connection issue | Check internet / firewall |
|
SSL_CERT | Certificate error | See macOS SSL Fix above |
|
API_ERROR | Pangolin API error | Check
api_code and
hint |
|
PARSE_ERROR | Invalid API response | Retry; may be transient |
Pangolin API Error Codes
| API Code | Meaning | Resolution |
|---|
| 1004 | Invalid token | Auto-retried by script. If persistent, re-auth. |
| 1009 |
Invalid parser name | Check
--mode value. |
| 2001 | Insufficient credits | Top up at
pangolinfo.com |
| 2005 | No active plan | Subscribe at
pangolinfo.com |
| 2007 | Account expired | Renew at
pangolinfo.com |
| 2009 | Usage limit reached | Wait for next billing cycle or contact support |
| 2010 | Bill day not configured | Contact support |
| 4029 | Rate limited (server) | Reduce request frequency |
| 10000 | Task execution failed | Retry. Check query format. |
| 10001 | Task execution failed | Retry. Likely transient. |
First-Time Setup
See references/setup-guide.md for detailed first-time setup instructions.
Quick start:
CODEBLOCK11
Important Notes for AI Agents
- 1. Run
--auth-only first if unsure about credentials. - Default to
ai-mode unless user explicitly asks for standard search. - Use
serp-plus when user wants cheaper SERP results and doesn't need the premium parser. - Never expose raw JSON to the user.
- Respond in the user's language.
- Keep follow-ups to 5 or fewer.
- Do not log API keys, passwords, or cookies.
- Mention credit cost when running multiple searches.
--screenshot is optional -- only when user wants visual results.--follow-up is ai-mode only.--region is SERP/SERP-Plus only.
Output Schema
See references/output-schema.md for the complete JSON output schema.
Pangolinfo AI SERP 技能
通过穿山甲API实现谷歌AI模式搜索与标准SERP提取,包含AI概览和引用来源。
何时使用此技能
触发条件:Google SERP抓取、AI概览提取、AI模式搜索、谷歌引用提取、抓取Google SERP、谷歌AI概览、引用来源提取
请勿将此技能用于:亚马逊产品搜索、谷歌趋势、谷歌地图或非谷歌搜索引擎。
前置条件
环境变量
设置以下任一变量:
| 变量 | 选项 | 描述 |
|---|
| PANGOLINAPIKEY | A(推荐) | API密钥——跳过登录 |
| PANGOLINEMAIL + PANGOLINPASSWORD |
B | 账户凭证 |
API密钥解析顺序:PANGOLINAPIKEY环境变量 > 缓存的~/.pangolinapikey(如已缓存)> 重新登录。
macOS SSL修复
若遇到错误代码SSL_CERT,请运行:
bash
/Applications/Python\ 3.x/Install\ Certificates.command
或:pip3 install certifi && export SSLCERTFILE=$(python3 -c import certifi; print(certifi.where()))
脚本执行
主脚本位于此技能目录下的scripts/pangolin.py。
bash
python3 scripts/pangolin.py --q 你的查询
意图到命令映射
AI模式搜索(默认)
带参考文献的AI生成答案。默认模式,消耗2积分。
bash
python3 scripts/pangolin.py --q 什么是量子计算
标准SERP
传统谷歌搜索结果 + 可选AI概览。消耗2积分。
bash
python3 scripts/pangolin.py --q 2025年最佳数据库 --mode serp
SERP Plus(更便宜)
与SERP相同,但仅消耗1积分。使用googleSearchPlus解析器。
bash
python3 scripts/pangolin.py --q 2025年最佳数据库 --mode serp-plus
带截图的SERP
bash
python3 scripts/pangolin.py --q 2025年最佳数据库 --mode serp --screenshot
带地区的SERP
bash
python3 scripts/pangolin.py --q 2025年最佳数据库 --mode serp --region us
多轮对话(仅AI模式)
bash
python3 scripts/pangolin.py --q kubernetes --follow-up 如何部署 --follow-up 监控工具
认证检查(不消耗积分)
bash
python3 scripts/pangolin.py --auth-only
所有CLI选项
| 选项 | 类型 | 默认值 | 描述 |
|---|
| --q | 字符串 | 必填 | 搜索查询 |
| --mode |
ai-mode \| serp \| serp-plus | ai-mode | API模式 |
| --screenshot | 标志 | 关闭 | 捕获页面截图 |
| --follow-up | 字符串(可重复) | 无 | 后续问题(仅ai-mode) |
| --num | 整数(1-100) | 10 | 结果数量 |
| --region | 字符串 | 无 | 地理区域(仅SERP/SERP-Plus)。见下方支持区域。 |
| --auth-only | 标志 | 关闭 | 仅认证检查(无查询,不消耗积分) |
| --raw | 标志 | 关闭 | 输出原始API响应 |
| --timeout | 整数 | 120 | 请求超时时间(秒) |
| --cache-key | 标志 | 关闭 | 将API密钥持久化到~/.pangolin
apikey。也可通过PANGOLIN_CACHE=1设置。 |
支持的区域
英语 | dk | 丹麦语 |
| au | 英语 | no | 挪威语 |
| ca | 英语 | se | 瑞典语 |
| nz | 英语 | nl | 荷兰语 |
| de | 德语 | pt | 葡萄牙语 |
| fr | 法语 | es | 西班牙语 |
| it | 意大利语 | jp | 日语 |
费用
| 模式 | 积分 | 解析器 |
|---|
| AI模式 | 2 | googleAiSearch |
| SERP |
2 | googleSearch |
| SERP Plus | 1 | googleSearchPlus |
仅在成功请求(API代码为0)时消耗积分。认证检查不消耗积分。
输出格式
成功时输出JSON到stdout,失败时输出结构化错误JSON到stderr。
成功示例(AI模式)
json
{
success: true,
task_id: 1768988520324-766a695d93b57aad,
results_num: 1,
aioverviewcount: 1,
ai_overview: [
{
content: [量子计算使用量子比特(qubits)...],
references: [
{
title: 量子计算 - 维基百科,
url: https://zh.wikipedia.org/wiki/量子计算,
domain: 维基百科
}
]
}
]
}
错误示例(stderr)
json
{
success: false,
error: {
code: API_ERROR,
message: 搜索API返回错误。,
api_code: 2001,
hint: 积分不足。请前往https://pangolinfo.com/?referrer=clawhub_serp充值
}
}
响应呈现
- 1. 使用自然语言——切勿直接输出原始JSON。
- 匹配用户使用的语言。
- 先总结AI概览,然后列出带URL的自然结果。
- 出错时,使用hint字段解释问题。
退出代码
API错误(穿山甲返回非零代码) |
| 2 | 使用错误(参数错误) |
| 3 | 网络错误 |
| 4 | 认证错误 |
错误参考
脚本错误代码
| 代码 | 含义 | 解决方法 |
|---|
| MISSINGENV | 无凭证 | 设置PANGOLINAPIKEY,或PANGOLINEMAIL + PANGOLINPASSWORD |
| AUTHFAILED |
凭证错误 | 验证邮箱和密码 |
| RATE_LIMIT | 请求过多 | 等待后重试 |
| NETWORK | 连接问题 | 检查网络/防火墙 |
| SSL_CERT | 证书错误 | 参见上方macOS SSL修复 |
| API
ERROR | 穿山甲API错误 | 检查apicode和hint |
| PARSE_ERROR | API响应无效 | 重试;可能是临时问题 |
穿山甲API错误代码
| API代码 | 含义 | 解决方法 |
|---|
| 1004 | 令牌无效 | 脚本自动重试。如持续出现,重新认证。 |
| 1009 |
解析器名称无效 | 检查--mode值。 |
| 2001 | 积分不足 | 前往
pangolinfo.com充值 |
| 2005 | 无有效套餐 | 前往
pangolinfo.com订阅 |
| 2007 | 账户已过期 | 前往
pangolinfo.com续费 |
| 2009 | 达到使用限制 | 等待下一个计费周期或联系支持 |
| 2010 | 账单日未配置 | 联系支持 |
| 4029 | 请求频率限制(服务器) | 降低请求频率 |
| 10000 | 任务执行失败 | 重试。检查查询格式。 |
| 100