竞品 SERP 分析
批量抓取行业核心词的 Google 搜索结果,分析竞品出现频次、Featured Snippet 占比、排名分布,输出竞品 SEO 能力对比报告。
涉及 API
| API | 用途 |
|---|---|
| Google Organic Live Advanced | 完整 SERP(含精选摘要、PAA、广告) |
| Google Organic Live Regular | 仅需 Top 10 有机结果时 |
工作流
1. 定义行业核心词列表(20–50 个)
2. 定义竞品域名列表
3. 批量 SERP 抓取
4. 统计每个竞品:出现次数、平均排名、Featured Snippet 次数
5. 生成对比报告Python 完整示例
import requests
from collections import defaultdict
API_KEY = "smt_live_YOUR_KEY"
BASE = "https://api.seermartech.cn/v3"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
CORE_KEYWORDS = [
"SEO工具", "关键词研究工具", "外链分析工具",
"网站排名查询", "竞品分析工具",
# ... 20–50 个行业词
]
COMPETITORS = ["competitor-a.com", "competitor-b.com", "mysite.com"]
def fetch_serp(keyword: str) -> list:
resp = requests.post(
f"{BASE}/serp/google/organic/live/advanced",
headers={**HEADERS, "Content-Type": "application/json"},
json=[{"keyword": keyword, "location_code": 2156, "language_code": "zh", "depth": 20}],
timeout=60,
)
resp.raise_for_status()
return resp.json()["tasks"][0]["result"][0]["items"]
def analyze_competitors():
stats = {c: {"appearances": 0, "ranks": [], "featured_snippets": 0} for c in COMPETITORS}
for kw in CORE_KEYWORDS:
items = fetch_serp(kw)
for item in items:
url = item.get("url", "")
for comp in COMPETITORS:
if comp in url:
stats[comp]["appearances"] += 1
if item.get("type") == "organic":
stats[comp]["ranks"].append(item.get("rank_absolute", 99))
if item.get("type") == "featured_snippet":
stats[comp]["featured_snippets"] += 1
# 输出报告
print(f"{'Domain':<25} {'Appearances':>12} {'Avg Rank':>10} {'FS':>5}")
print("-" * 55)
for comp, s in stats.items():
avg_rank = sum(s["ranks"]) / len(s["ranks"]) if s["ranks"] else 0
print(f"{comp:<25} {s['appearances']:>12} {avg_rank:>10.1f} {s['featured_snippets']:>5}")
if __name__ == "__main__":
analyze_competitors()TypeScript
const API_KEY = "smt_live_YOUR_KEY";
const COMPETITORS = ["competitor-a.com", "competitor-b.com", "mysite.com"];
async function fetchSerp(keyword: string) {
const resp = await fetch(
"https://api.seermartech.cn/v3/serp/google/organic/live/advanced",
{
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify([{
keyword,
location_code: 2156,
language_code: "zh",
depth: 20,
}]),
}
);
const data = await resp.json();
return data.tasks[0].result[0].items;
}
type Stats = Record<string, { appearances: number; ranks: number[]; featuredSnippets: number }>;
async function analyze(keywords: string[]): Promise<Stats> {
const stats: Stats = Object.fromEntries(
COMPETITORS.map((c) => [c, { appearances: 0, ranks: [], featuredSnippets: 0 }])
);
for (const kw of keywords) {
const items = await fetchSerp(kw);
for (const item of items) {
const url = item.url ?? "";
for (const comp of COMPETITORS) {
if (!url.includes(comp)) continue;
stats[comp].appearances++;
if (item.type === "organic") stats[comp].ranks.push(item.rank_absolute ?? 99);
if (item.type === "featured_snippet") stats[comp].featuredSnippets++;
}
}
}
return stats;
}报告指标说明
| 指标 | 含义 | 业务价值 |
|---|---|---|
| Appearances | 在多少核心词 SERP 中出现 | 可见度广度 |
| Avg Rank | 出现时的平均排名 | 可见度深度 |
| FS (Featured Snippet) | 获得精选摘要次数 | 内容权威度信号 |
| Top 3 Rate | 排名前 3 的比例 | 高价值流量占比 |
成本估算
| 规模 | 模式 | 参考费用 |
|---|---|---|
| 30 核心词 × Advanced | Live | ≈ ¥0.96 |
| 50 核心词 × Advanced | Live | ≈ ¥1.60 |
| 50 核心词 × Regular(仅 Top 10) | Live | ≈ ¥1.60 |
建议每月跑一次完整分析,新竞品加入或行业词库更新时再跑。
最佳实践
- 词库选择:从 关键词研究工作流 输出的高搜索量词中选取 Top 30–50
- depth 控制:分析 Top 20 足够,设
depth: 20节省 cost - SERP 特征:Advanced 版可统计 PAA、广告位,Regular 仅有机
- 多地区:出海业务需按
location_code分地区跑,见 位置代码参考 - 结合外链:SERP 可见度 + 外链对比 = 完整竞品画像