Pangolin SERP & Scrape
New canonical (AI SERP): https://clawhub.ai/pangolinfo/pangolinfo-ai-serp
Amazon skill: https://clawhub.ai/pangolinfo/pangolinfo-amazon-scraper
Search Google and scrape Amazon programmatically via Pangolin APIs. Extract AI overviews, organic search results, Amazon product data, and page screenshots.
Prerequisites
- - Python 3.6+ (uses only standard library)
- Pangolin account at pangolinfo.com
- Environment variables (one of):
-
PANGOLIN_TOKEN -- existing bearer token
-
PANGOLIN_EMAIL +
PANGOLIN_PASSWORD -- for automatic login
Quick Start
AI Mode Search (Google AI Overview)
CODEBLOCK0
Standard SERP with AI Overview
CODEBLOCK1
Multi-Turn Dialogue
CODEBLOCK2
Amazon Product Detail
CODEBLOCK3
Amazon Keyword Search
CODEBLOCK4
Workflow
- 1. Authenticate -- Token resolved from env var, cache (
~/.pangolin_token), or fresh login - Choose API mode --
ai-mode | serp | INLINECODE6 - Execute -- Script builds the request, calls the API with retry logic
- Parse output -- Structured JSON to stdout
Usage
AI Mode (--mode ai-mode)
Uses parserName: "googleAISearch" with udm=50 to get Google AI Mode results.
CODEBLOCK5
Output includes ai_overview with content paragraphs and source references.
AI Overview SERP (--mode serp)
Uses parserName: "googleSearch" for standard SERP results with AI overview extraction.
CODEBLOCK6
Output includes both organic_results and optional ai_overview.
Multi-Turn Follow-Up
Add follow-up questions to an AI Mode search. Keep to 5 or fewer for optimal performance (more is allowed but slower):
CODEBLOCK7
Amazon (--mode amazon)
Scrape Amazon product data using various parsers.
Product detail by URL:
CODEBLOCK8
Keyword search:
CODEBLOCK9
Best sellers:
CODEBLOCK10
With custom zipcode and raw HTML:
CODEBLOCK11
Available Amazon parsers:
| Parser | Use Case |
|---|
| INLINECODE16 | Single product page (default) |
| INLINECODE17 |
Keyword search results |
|
amzProductOfCategory | Category listing |
|
amzProductOfSeller | Seller's products |
|
amzBestSellers | Best sellers ranking |
|
amzNewReleases | New releases ranking |
|
amzFollowSeller | Product variants / other sellers |
Authentication Only
CODEBLOCK12
Raw API Response
CODEBLOCK13
All CLI Options
CODEBLOCK14
Choosing the Right API
| Feature | AI Mode | SERP | Amazon |
|---|
| Parser | INLINECODE23 | INLINECODE24 | INLINECODE25 (7 types) |
| Input |
--q |
--q |
--url or
--q |
| Primary output | AI-generated answer | Organic results + AI overview | Product data |
| Multi-turn | Yes (via
--follow-up) | No | No |
| Screenshot | Yes | Yes | No |
| Best for | AI answers | Search results with AI context | Product & market data |
| Cost | 2 credits | 2 credits | 1 credit (json) / 0.75 (raw) |
Output Format
Google (ai-mode / serp)
CODEBLOCK15
Amazon
CODEBLOCK16
See reference files for full response schemas.
Exit Codes
API error (non-zero response code) |
| 2 | Usage error (invalid arguments) |
| 3 | Network error |
| 4 | Authentication error |
Troubleshooting
| Problem | Solution |
|---|
| Auth fails | Check PANGOLIN_EMAIL and PANGOLIN_PASSWORD env vars |
| Empty AI overview |
Not all queries trigger AI overview; try informational queries |
| Token invalid (1004) | Script auto-refreshes; ensure email/password env vars are set |
| Insufficient credits (2001) | Top up at pangolinfo.com |
| Timeout | Script retries 3x with backoff; check network |
| Amazon returns empty | Verify the URL and parser match (e.g. product URL +
amzProductDetail) |
See references/error-codes.md for the full error code reference.
Deep-Dive Documentation
AI Overview SERP API schema, organic result structure |
|
references/amazon-api.md | Amazon Scrape API, all parser types, product fields |
|
references/error-codes.md | Error codes, auth lifecycle, credit management |
Pangolin SERP & Scrape
新版规范(AI SERP): https://clawhub.ai/pangolinfo/pangolinfo-ai-serp
亚马逊技能: https://clawhub.ai/pangolinfo/pangolinfo-amazon-scraper
通过Pangolin API以编程方式搜索Google并抓取亚马逊。提取AI概览、自然搜索结果、亚马逊产品数据和页面截图。
前提条件
- PANGOLIN_TOKEN -- 现有的Bearer令牌
- PANGOLIN
EMAIL + PANGOLINPASSWORD -- 用于自动登录
快速开始
AI模式搜索(Google AI概览)
bash
python3 scripts/pangolin.py --q 什么是量子计算 --mode ai-mode
带AI概览的标准SERP
bash
python3 scripts/pangolin.py --q Java如何工作 --mode serp --screenshot
多轮对话
bash
python3 scripts/pangolin.py --q Python Web框架 --mode ai-mode \
--follow-up 比较Flask和Django \
--follow-up 哪个更适合初学者
亚马逊产品详情
bash
python3 scripts/pangolin.py --url https://www.amazon.com/dp/B0DYTF8L2W --mode amazon
亚马逊关键词搜索
bash
python3 scripts/pangolin.py --q 无线鼠标 --mode amazon --parser amzKeyword
工作流程
- 1. 身份验证 -- 从环境变量、缓存(~/.pangolin_token)或全新登录解析令牌
- 选择API模式 -- ai-mode | serp | amazon
- 执行 -- 脚本构建请求,使用重试逻辑调用API
- 解析输出 -- 结构化JSON输出到标准输出
使用方法
AI模式(--mode ai-mode)
使用 parserName: googleAISearch 并设置 udm=50 获取Google AI模式结果。
bash
python3 scripts/pangolin.py --q 解释机器学习 --mode ai-mode
输出包含 ai_overview,其中包含内容段落和来源引用。
AI概览SERP(--mode serp)
使用 parserName: googleSearch 获取标准SERP结果并提取AI概览。
bash
python3 scripts/pangolin.py --q 2025年最佳编程语言 --mode serp
输出同时包含 organicresults 和可选的 aioverview。
多轮追问
向AI模式搜索添加追问问题。建议不超过5个以获得最佳性能(允许更多但速度较慢):
bash
python3 scripts/pangolin.py --q Kubernetes --mode ai-mode \
--follow-up 如何部署 \
--follow-up 监控工具 \
--follow-up 成本优化
亚马逊(--mode amazon)
使用各种解析器抓取亚马逊产品数据。
通过URL获取产品详情:
bash
python3 scripts/pangolin.py --url https://www.amazon.com/dp/B0DYTF8L2W --mode amazon
关键词搜索:
bash
python3 scripts/pangolin.py --q 机械键盘 --mode amazon --parser amzKeyword
畅销商品:
bash
python3 scripts/pangolin.py --url https://www.amazon.com/gp/bestsellers/electronics \
--mode amazon --parser amzBestSellers
自定义邮编和原始HTML:
bash
python3 scripts/pangolin.py --url https://www.amazon.com/dp/B0DYTF8L2W \
--mode amazon --zipcode 90210 --format rawHtml
可用的亚马逊解析器:
| 解析器 | 用途 |
|---|
| amzProductDetail | 单个产品页面(默认) |
| amzKeyword |
关键词搜索结果 |
| amzProductOfCategory | 分类列表 |
| amzProductOfSeller | 卖家产品 |
| amzBestSellers | 畅销排名 |
| amzNewReleases | 新品发布排名 |
| amzFollowSeller | 产品变体/其他卖家 |
仅身份验证
bash
python3 scripts/pangolin.py --auth-only
原始API响应
bash
python3 scripts/pangolin.py --q 测试 --mode ai-mode --raw
所有CLI选项
--q QUERY 搜索查询
--url URL 目标URL(用于亚马逊产品页面、分类页面等)
--mode MODE ai-mode(默认)| serp | amazon
--screenshot 捕获页面截图(仅Google)
--follow-up TEXT 追问问题(可重复,仅ai-mode)
--num N 结果数量(默认:10,仅Google)
--parser PARSER 亚马逊解析器名称(默认:amzProductDetail)
--zipcode CODE 亚马逊邮编(默认:10041)
--format FMT 亚马逊响应格式:json(默认)| rawHtml | markdown
--auth-only 身份验证并显示令牌信息
--raw 输出原始API响应
选择合适的API
| 功能 | AI模式 | SERP | 亚马逊 |
|---|
| 解析器 | googleAISearch | googleSearch | amz*(7种类型) |
| 输入 |
--q | --q | --url 或 --q |
| 主要输出 | AI生成的回答 | 自然结果 + AI概览 | 产品数据 |
| 多轮对话 | 是(通过 --follow-up) | 否 | 否 |
| 截图 | 是 | 是 | 否 |
| 最佳用途 | AI回答 | 带AI上下文的搜索结果 | 产品和市场数据 |
| 成本 | 2积分 | 2积分 | 1积分(json)/ 0.75(raw) |
输出格式
Google(ai-mode / serp)
json
{
success: true,
task_id: ...,
results_num: 1,
aioverviewcount: 1,
ai_overview: [{content: [...], references: [{title: ..., url: ..., domain: ...}]}],
organic_results: [{title: ..., url: ..., text: ...}],
screenshot: https://...
}
亚马逊
json
{
success: true,
task_id: ...,
url: https://www.amazon.com/dp/...,
results_count: 1,
product: {asin: ..., title: ..., price: ..., star: ..., rating: ...}
}
完整响应模式请参考相关文件。
退出代码
API错误(非零响应代码) |
| 2 | 使用错误(无效参数) |
| 3 | 网络错误 |
| 4 | 身份验证错误 |
故障排除
| 问题 | 解决方案 |
|---|
| 身份验证失败 | 检查 PANGOLINEMAIL 和 PANGOLINPASSWORD 环境变量 |
| AI概览为空 |
并非所有查询都会触发AI概览;尝试信息性查询 |
| 令牌无效(1004) | 脚本自动刷新;确保已设置邮箱/密码环境变量 |
| 积分不足(2001) | 在 pangolinfo.com 充值 |
| 超时 | 脚本重试3次并退避;检查网络 |
| 亚马逊返回空结果 | 验证URL和解析器是否匹配(例如产品URL + amzProductDetail) |
完整错误代码参考请参见 references/error-codes.md。
深度文档
AI概览SERP API模式、自然结果结构 |
|
references/amazon-api.md | 亚马逊抓取API、所有解析器类型、产品字段 |
|
references/error-codes.md | 错误代码、身份验证生命周期、积分管理 |