主题
backlinks/id_list
POST /v3/backlinks/id_list
本接口使用 POST 方法,路径为 /v3/backlinks/id_list,用于查询指定时间范围创建的所有 Backlinks 任务,并返回任务 ID 及数据。结果已完成、执行中以及未完成的任务。
> 注意: > > - 查询时间范围最多可追溯至调用接口前 6 个月。 > - 支持查询最近 1 个月创建任务的数据。 > - 每分钟最多调用 10 次。 > - 单次请求最多返回 1000 个任务 ID。 > - 请求体使用 UTF-8 编码的 JSON 数组。
计费说明
调用本接口不收取费用,响应中的顶层 cost 通常为 0。历史任务对象中的 cost 表示对应任务的记录成本,参考价约为人民币金额;扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求地址
text
POST https://api.seermartech.cn/v3/backlinks/id_list请求参数
请求体是 JSON 数组,数组中的每个对象代表一组查询条件。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
datetime_from | string | 是 | 结果筛选的起始时间。<br>当 include_metadata 为 true 时,最多只能查询当前时间前 1 个月;当 include_metadata 为 false 时,最多可查询当前时间前 6 个月。<br>使用 UTC 时间格式:yyyy-mm-dd hh-mm-ss +00:00。示例:2023-01-15 12:57:46 +00:00 |
datetime_to | string | 是 | 结果筛选的结束时间,不能晚于当前时间。<br>使用 UTC 时间格式:yyyy-mm-dd hh-mm-ss +00:00。示例:2023-01-31 13:57:46 +00:00 |
limit | integer | 否 | 返回的最大任务数量。默认值为 1000,最大值为 1000。 |
offset | integer | 否 | 结果偏移量,默认值为 0。例如设置为 10 时,将跳过结果中的前 10 个任务。 |
sort | string | 否 | 按任务执行时间排序。可选值:asc、desc。默认值为 asc。 |
include_metadata | boolean | 否 | 是否在结果中返回任务数据。默认值为 false。设置为 true 时,datetime_from 最多只能追溯 1 个月。 |
请求示例
json
[
{
"datetime_from": "2023-01-31 00:00:00 +00:00",
"datetime_to": "2023-02-01 00:00:00 +00:00",
"limit": 100,
"offset": 0,
"sort": "desc",
"include_metadata": true
}
]响应结构
接口返回 JSON 数据 tasks 数组本次查询到的任务信息。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 整体响应状态码。成功时通常为 20000。 |
status_message | string | 整体响应说明。 |
time | string | 请求总执行时间,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,采用 UUID 格式。 |
status_code | integer | 任务状态码,通常位于 10000 至 60000 范围。 |
status_message | string | 任务状态说明。 |
time | string | 任务执行时间,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量。 |
path | array | 请求路径信息。 |
data | object | 创建任务时提交的参数。 |
result | array | 任务 ID 查询结果数组。 |
tasks[].result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID。 |
url | string | 创建该任务时使用的 API 路径,例如 v3/backlinks/summary/live。 |
datetime_posted | string | 任务创建时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
datetime_done | string | 任务完成时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。任务未完成时可能为空。 |
status | string | 任务状态或状态码。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
metadata | object | 创建对应任务时提交的参数在 include_metadata 为 true 时返回。 |
认证方式
请求头中使用 Bearer Token:
http
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/jsoncurl 示例
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/backlinks/id_list" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"datetime_from": "2023-01-31 00:00:00 +00:00",
"datetime_to": "2023-02-01 00:00:00 +00:00",
"limit": 100,
"offset": 0,
"sort": "desc",
"include_metadata": true
}
]'TypeScript 示例
typescript
import axios from "axios";
const postData = [
{
datetime_from: "2023-01-31 00:00:00 +00:00",
datetime_to: "2023-02-01 00:00:00 +00:00",
limit: 100,
offset: 0,
sort: "desc",
include_metadata: true
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/backlinks/id_list",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: postData
})
.then((response) => {
// 处理接口返回结果
console.log(response.data);
})
.catch((error) => {
// 处理请求错误
console.error(error.response?.data || error.message);
});Python 示例
python
import requests
url = "https://api.seermartech.cn/v3/backlinks/id_list"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
post_data = [
{
"datetime_from": "2023-01-31 00:00:00 +00:00",
"datetime_to": "2023-02-01 00:00:00 +00:00",
"limit": 100,
"offset": 0,
"sort": "desc",
"include_metadata": True,
}
]
response = requests.post(url, headers=headers, json=post_data)
result = response.json()
if result.get("status_code") == 20000:
# 处理成功结果
print(result)
else:
print(
"请求失败。状态码:%s,说明:%s"
% (result.get("status_code"), result.get("status_message"))
)响应示例
json
{
"version": "0.1.20221214",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.3275 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02101102-1535-0265-0000-4f8739f65fcf",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.3275 sec.",
"cost": 0,
"result_count": 3,
"path": [
"v3",
"backlinks",
"id_list"
],
"data": {
"api": "backlinks",
"function": "id_list",
"datetime_from": "2023-01-11 00:00:00 +00:00",
"datetime_to": "2023-02-10 18:23:00 +00:00",
"limit": 100,
"sort": "desc",
"include_metadata": true
},
"result": [
{
"id": "02101102-1535-0265-0000-4f8739f65fcf",
"url": "v3/backlinks/summary/live",
"datetime_posted": "2023-02-10 16:04:56 +00:00",
"datetime_done": "2023-02-10 16:04:56 +00:00",
"status": "20000",
"cost": 0.1442,
"metadata": {
"api": "backlinks",
"function": "summary",
"target": "explodingtopics.com",
"internal_list_limit": 10,
"include_subdomains": true,
"backlinks_filters": [],
"backlinks_status_type": "all"
}
},
{
"id": "02101804-1535-0265-0000-4f8739f65fcf",
"url": "v3/backlinks/domain_intersection/live",
"datetime_posted": "2023-02-10 16:04:56 +00:00",
"datetime_done": "2023-02-10 16:04:56 +00:00",
"status": "20000",
"cost": 0.1505,
"metadata": {
"api": "backlinks",
"function": "domain_intersection",
"targets": {
"1": "youtube.com",
"2": "homebuilding.co.uk",
"3": "familyhandyman.com"
},
"exclude_targets": [],
"limit": 30
}
}
]
}
]
}状态码与错误处理
- 顶层
status_code为20000:请求成功。 tasks_error大于0:表示部分任务返回错误,需要继续检查对应任务对象中的status_code和status_message。- 任务级状态码用于表示单个任务的执行结果。
- 完整状态码和错误说明请参考错误码文档。
实用场景
- 分页获取历史任务 ID:按时间范围和
offset、limit分批拉取任务,支持大规模 Backlinks 任务的归档与追踪。 - 恢复任务执行记录:查询指定时间段未完成或异常的任务,便于补偿执行和障排查。
- 不同 Backlinks 报告:通过返回的
url和id区分摘要、域名交集等任务类型,统一建立任务管理索引。 - 审计任务参数与成本:启用
include_metadata后核对任务目标、过滤条件及历史成本,便于 SEO 项目复盘和费用核算。 - 同步 SEO 数据流水线:定时获取新创建的 Backlinks 任务列表,将任务 ID 分发到后续结果查询或数据仓库流程中。