主题
批量查询新增与丢失外链(实时)
接口说明
该接口用于批量获取指定目标的新增外链数量与丢失外链数量。目标可为:
- 域名
- 子域名
- 网页 URL
请求时通过 targets 数组传多个目标,接口会分别返回每个目标对应的新增/丢失外链统计结果。
统计规则
- 如果传的是域名,返回结果将基于根域名及所有子域名汇总统计 例如:
example.com会app.example.com等子域数据 - 历史数据最长支持查询最近 365 天
date_from用作“新增 / 丢失”的判定阈值:- 在该日期之后索引的外链,记为新增外链
- 在该日期之后未再发现、但此前存在的外链,记为丢失外链
接口地址
POST https://api.seermartech.cn/v3/backlinks/bulk_new_lost_backlinks/live
计费与调用限制
- 按请求计费
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准 - 请求体为 UTF-8 编码的 JSON
- POST 请求体格式为 JSON 数组:
[{ ... }] - 最高调用频率:2000 次/分钟
- 最大并发请求数:30
请求参数
顶层请求体示例
json
[
{
"targets": [
"forbes.com",
"cnn.com",
"bbc.com",
"https://www.apple.com/iphone/"
],
"date_from": "2021-01-01",
"tag": "backlinks-check-001"
}
]参数说明
| 字段 | 类型 | 填 | 说明 |
|---|---|---|---|
targets | array | 是 | 需要查询新增与丢失外链的域名、子域名或网页列表。最多支持 1000 个目标。域名或子域名不要 https:// 和 www.;网页使用完整绝对 URL( http:// 或 https://)。 |
date_from | string | 否 | 统计时间范围的起始日期,格式为 yyyy-mm-dd。该日期会作为新增/丢失外链的判定阈值。默认值为今天减去 1 个月。最早可设置为今天减去 1 年。例如今天为 2021-10-13,默认值为 2021-09-13,最小值为 2020-10-13。 |
tag | string | 否 | 自定义任务标识,最长 255 个字符。可用于在响应中识别和匹任务。 |
返回结果
接口返回 JSON 数据,顶层 tasks 数组,每个任务对应一次提交的请求对象。
顶层字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 接口总体状态码。完整错误码见 /v3/appendix/errors |
status_message | string | 接口总体状态信息 |
time | string | 执行时间,单位秒 |
cost | float | 本次请求总费用,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | 返回错误的任务数量 |
tasks | array | 任务结果列表 |
tasks 数组字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态信息 |
time | string | 任务执行时间,单位秒 |
cost | float | 单个任务费用,单位 USD |
result_count | integer | result 数组中的结果数量 |
path | array | 请求路径 |
data | object | 回显请求参数 |
result | array | 结果数组 |
result 数组字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
items_count | integer | items 数组中的结果数 |
items | array | 目标维度的新增/丢失外链统计结果 |
items 数组字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
target | string | 请求中提交的域名、子域名或网页 |
new_backlinks | integer | 指向该 target 的新增外链数量 |
lost_backlinks | integer | 该 target 的丢失外链数量 |
请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/backlinks/bulk_new_lost_backlinks/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"targets": [
"forbes.com",
"cnn.com",
"bbc.com",
"yelp.com",
"https://www.apple.com/iphone/",
"https://ahrefs.com/blog/",
"ibm.com",
"https://variety.com/",
"https://stackoverflow.com/",
"trustpilot.com"
],
"date_from": "2021-01-01",
"tag": "bulk-backlinks-live"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/backlinks/bulk_new_lost_backlinks/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
payload = [
{
"targets": [
"forbes.com",
"cnn.com",
"bbc.com",
"yelp.com",
"https://www.apple.com/iphone/",
"https://ahrefs.com/blog/",
"ibm.com",
"https://variety.com/",
"https://stackoverflow.com/",
"trustpilot.com"
],
"date_from": "2021-01-01",
"tag": "bulk-backlinks-live"
}
]
response = requests.post(url, json=payload, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
const payload = [
{
targets: [
"forbes.com",
"cnn.com",
"bbc.com",
"yelp.com",
"https://www.apple.com/iphone/",
"https://ahrefs.com/blog/",
"ibm.com",
"https://variety.com/",
"https://stackoverflow.com/",
"trustpilot.com"
],
date_from: "2021-01-01",
tag: "bulk-backlinks-live"
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/backlinks/bulk_new_lost_backlinks/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: payload
})
.then((response) => {
// 输出接口返回结果
console.log(response.data);
})
.catch((error) => {
console.error(error);
});响应示例
json
{
"version": "0.1.20210917",
"status_code": 20000,
"status_message": "Ok.",
"time": "2.2157 sec.",
"cost": 0.0203,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "b1f1c1d2-1234-5678-90ab-cdef12345678",
"status_code": 20000,
"status_message": "Ok.",
"time": "2.1021 sec.",
"cost": 0.0203,
"result_count": 1,
"path": [
"v3",
"backlinks",
"bulk_new_lost_backlinks",
"live"
],
"data": {
"api": "backlinks",
"function": "bulk_new_lost_backlinks",
"targets": [
"forbes.com",
"cnn.com",
"bbc.com",
"https://www.apple.com/iphone/"
],
"date_from": "2021-01-01"
},
"result": [
{
"items_count": 4,
"items": [
{
"target": "forbes.com",
"new_backlinks": 1250,
"lost_backlinks": 410
},
{
"target": "cnn.com",
"new_backlinks": 980,
"lost_backlinks": 275
},
{
"target": "bbc.com",
"new_backlinks": 1143,
"lost_backlinks": 322
},
{
"target": "https://www.apple.com/iphone/",
"new_backlinks": 156,
"lost_backlinks": 48
}
]
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整个请求的处理状态 tasks[].status_code表示单个任务的处理状态- 建议同时校验这两个层级的状态码,并为异常设计重试、告警和底逻辑
- 完整错误码与信息说明参考:
/v3/appendix/errors
常见处理建议:
| 场景 | 建议 |
|---|---|
status_code != 20000 | 视为请求级失败,记录日志并检查认证、参数格式或频率限制 |
tasks_error > 0 | 存在任务级失败,需逐个检查 tasks 中的状态信息 |
targets 格式不符合要求 | 域名不要带 https:// 和 www.,网页传完整 URL |
date_from出范围 | 将日期调整到最近 365 天,并使用 yyyy-mm-dd 格式 |
使用建议
- 当你需要一次性对多个站点或页面做外链趋势监测时,优使用本接口,可显著减少请求次数
- 如果需要更稳定地比较周期变化,建议固定
date_from规则,例如统一按近 30 天、近 90 天进行统计 - 域名、子域名和页面 URL 的统计口径不同,做横向比较时应保持目标类型一致
实用场景
- 监控品牌站点外链波动:批量跟踪官网、博客、产品页的新增与丢失外链,及时发现品牌增长或链接流失问题。
- 评估推广效果:对活动落地页或专题文章按时间窗口统计新增外链,判断 PR、分发和媒介投放带来的外链增量价值。
- 预警 SEO 风险:持续观察重点页面的丢失外链数量,快速识别失效合作、页面下线或引用撤稿等风险来源。
- 对比竞争对手外链增长:批量查询多个竞品域名的新增/丢失外链变化,评估外链建设节奏和市场传播趋势。
- 筛选值得重点维护的页面:通过页面级新增/丢失外链数据识别高潜力 URL,优更新、链支持和转化优化资源。