SeerMarTech 文档控制台

用量与成本控制

合理使用 API 参数、监控余额、选择合适模式,可将 SEO 数据成本控制在预算内。

核心成本杠杆

杠杆影响建议
Live vs Queue最高 70% 差异批量用 Standard Queue
depth 参数线性影响页数排名监控设 depth=50 而非 100
Regular vs Advanced字段量不同,cost 相近只需排名用 Regular
批量合并减少请求次数search_volume 一次 1000 词

depth 与计费规则

SERP API 按「页」计费:首页 10 条 = 1 页基础价,每额外 10 条 = 0.75 × 基础价。

depth等价页数Live 参考 cost
101 页≈ ¥0.032
202 页(1 + 0.75)≈ ¥0.056
505 页≈ ¥0.128
1008.5 页≈ ¥0.218

建议:排名监控只需找到目标域名位置,设 depth: 50 通常足够;完整 SERP 分析再用 depth: 100

余额监控

每次 API 响应包含余额相关 Header:

Header说明
X-SeerMarTech-Charge-CNY本次扣费
X-SeerMarTech-Balance-CNY扣费后余额
X-SeerMarTech-Cost-USD上游 cost(USD)

Python 余额告警

import requests API_KEY = "smt_live_YOUR_KEY" ALERT_THRESHOLD = 50.0 # 余额低于 ¥50 告警 def call_with_balance_check(payload: list) -> dict: resp = requests.post( "https://api.seermartech.cn/v3/serp/google/organic/live/regular", headers={"Authorization": f"Bearer {API_KEY}"}, json=payload, timeout=60, ) balance = float(resp.headers.get("X-SeerMarTech-Balance-CNY", 0)) charge = float(resp.headers.get("X-SeerMarTech-Charge-CNY", 0)) if balance < ALERT_THRESHOLD: send_alert(f"余额不足: ¥{balance:.2f},请及时充值") print(f"charge=¥{charge:.4f}, balance=¥{balance:.2f}") return resp.json() def send_alert(message: str): # 接入钉钉 / 飞书 / 邮件 print(f"[ALERT] {message}")

TypeScript

const ALERT_THRESHOLD = 50; async function callWithBalanceCheck(keyword: string) { const resp = await fetch( "https://api.seermartech.cn/v3/serp/google/organic/live/regular", { method: "POST", headers: { Authorization: "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json", }, body: JSON.stringify([{ keyword, location_code: 2156, language_code: "zh" }]), } ); const balance = parseFloat(resp.headers.get("X-SeerMarTech-Balance-CNY") ?? "0"); if (balance < ALERT_THRESHOLD) { console.warn(`余额不足: ¥${balance}`); } return resp.json(); }

余额不足处理

当余额 < 单次预估 cost 时,网关返回:

{ "status_code": 50002, "status_message": "Insufficient balance" }

HTTP 状态码 402。建议在业务层捕获并重试逻辑中排除此错误(重试无效,需充值)。

Sandbox 测试策略

环境Key 前缀扣费用途
生产smt_live_实际扣费正式业务
沙箱smt_sandbox_不计费(如已开通)开发联调

开发阶段建议:

  1. 用 Sandbox Key 验证请求格式与响应解析
  2. 上线前用小批量 Live 请求验证计费
  3. 控制台 用量 页查看历史 cost 分布

批量任务合并技巧

# 不推荐:100 个词逐个 search_volume for kw in keywords: search_volume([kw]) # 100 次请求 # 推荐:每批 1000 词 for i in range(0, len(keywords), 1000): search_volume(keywords[i:i+1000]) # ceil(n/1000) 次请求

月度预算估算模板

业务调用量/月模式月费用估算
排名监控 100 词/天3000Standard Queue≈ ¥29
关键词研究5 次完整流程Live≈ ¥65
竞品 SERP 分析50 词 × 1 次Live Advanced≈ ¥1.6
外链季度对比9 次/季Live≈ ¥9
合计≈ ¥100–110/月

相关文档