主题
反向链接时间序列摘要
POST /v3/backlinks/timeseries_summary/live
本接口使用 POST 方法,请求路径为:
/v3/backlinks/timeseries_summary/live
用于获取指定域名在一段时间的反向链接汇总数据,并按日、周、月或年进行分组。返回结果适合用于构建链接建设趋势图、反向链接增长报表和历史 SEO 分析。
历史数据最早可追溯至 2019-01-30。
接口信息
- 请求地址:
https://api.seermartech.cn/v3/backlinks/timeseries_summary/live - 请求方法:
POST - 请求格式:JSON,UTF-8 编码
- 请求体格式:JSON 数组
- 单次请求任务数:每次 Live API 请求支持 1 个任务 平台限流以认证说明中的 30/60/120 次/分钟规则为准/分钟
- 并发限制:最多同时发送 30 个请求
每次请求均会产生费用。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求体是 JSON 数组,例如:
json
[
{
"target": "example.com",
"date_from": "2021-12-01",
"date_to": "2022-02-01",
"group_range": "month"
}
]任务参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
target | string | 是 | 要查询的目标域名。填写时不要 https:// 或 www.,例如 forbes.com。 |
date_from | string | 否 | 时间范围起始日期,格式为 yyyy-mm-dd。最早支持 2019-01-30,且不能晚于 date_to。 |
date_to | string | 否 | 时间范围结束日期,格式为 yyyy-mm-dd。未指定时默认为当天日期,不能早于 date_from。 |
group_range | string | 否 | 结果分组粒度。可选值为 day、week、month、year,默认值为 month。 |
include_subdomains | boolean | 否 | 是否将目标域名的子域名纳统计。false 表示忽略子域名,默认值为 true。 |
rank_scale | string | 否 | rank、domain_from_rank 和 page_from_rank 的计算与展示范围。可选值:one_hundred(0–100)和 one_thousand(0–1000),默认值为 one_thousand。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。该值会原样返回在响应的 data 对象中,可用于请求与结果。 |
group_range 说明
day:返回date_from与date_to之间(起止日期)的每日数据。week:按完整周返回数据,每条记录使用该周最后一天作为日期。month:按完整月返回数据,每条记录使用该月最后一天作为日期。year:按完整年返回数据,每条记录使用该年最后一天作为日期。- 如果某个日期、周、月或年没有数据,对应指标将返回
0。
例如:
json
{
"group_range": "month",
"date_from": "2022-03-23",
"date_to": "2022-05-13"
}按月分组时,返回范围会扩展至完整月份,即返回以下三个时间点的数据:
2022-03-312022-04-302022-05-31
响应结构
接口返回 JSON 数据,顶层 tasks 数组。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。 |
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 | 请求 URL 路径信息。 |
data | object | 请求中提交的任务参数。 |
result | array | 任务结果数组。 |
结果字段
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
target | string | 请求中的目标域名。 |
date_from | string | 时间范围起始日期,UTC 格式 yyyy-mm-dd。 |
date_to | string | 时间范围结束日期,UTC 格式 yyyy-mm-dd。 |
group_range | string | 请求中指定的结果分组粒度。 |
total_count | integer | 与请求的结果总数。 |
items_count | integer | items 数组中返回的结果数量。 |
items | array | 按指定时间粒度汇总的反向链接数据。 |
items 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 数据类型,固定为 backlinks_timeseries_summary。 |
date | string | 目标数据的存储日期和时间,UTC 格式为 yyyy-mm-dd hh-mm-ss +00:00。 |
rank | integer | 目标域名在指定日期的排名指标。取值范围由 rank_scale 决定。 |
backlinks | integer | 指定日期的反向链接数量。 |
backlinks_nofollow | integer | 指定日期的 nofollow 反向链接数量。 |
referring_pages | integer | 指向目标域名的来源页面数量。 |
referring_domains | integer | 来源域名数量。该指标会将子域名作为独立域名计算。 |
referring_domains_nofollow | integer | 至少向目标域名指向一条 nofollow 链接的来源域名数量。 |
referring_main_domains | integer | 来源主域名数量。 |
referring_main_domains_nofollow | integer | 至少向目标域名指向一条 nofollow 链接的来源主域名数量。 |
referring_ips | integer | 指向目标域名的来源 IP 地址数量。 |
referring_subnets | integer | 来源子网数量。 |
referring_pages_nofollow | integer | 至少向目标域名指向一条 nofollow 链接的来源页面数量。 |
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/backlinks/timeseries_summary/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"target": "example.com",
"date_from": "2021-12-01",
"date_to": "2022-02-01",
"group_range": "month"
}
]'PHP
php
<?php
$apiUrl = 'https://api.seermartech.cn/v3/backlinks/timeseries_summary/live';
$postData = [
[
'target' => 'example.com',
'date_from' => '2021-12-01',
'date_to' => '2022-02-01',
'group_range' => 'month'
]
];
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($postData, JSON_UNESCAPED_UNICODE)
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;TypeScript
typescript
import axios from "axios";
const postData = [
{
target: "example.com",
date_from: "2021-12-01",
date_to: "2022-02-01",
group_range: "month",
},
];
axios
.post(
"https://api.seermartech.cn/v3/backlinks/timeseries_summary/live",
postData,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.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/timeseries_summary/live"
post_data = [
{
"target": "example.com",
"date_from": "2021-12-01",
"date_to": "2022-02-01",
"group_range": "month"
}
]
response = requests.post(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
json=post_data
)
if response.ok:
result = response.json()
print(result)
else:
print(f"HTTP 错误:{response.status_code}")
print(response.text)C#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class BacklinksTimeseriesExample
{
public static async Task Main()
{
using var httpClient = new HttpClient();
var postData = new[]
{
new
{
target = "example.com",
date_from = "2021-12-01",
date_to = "2022-02-01",
group_range = "month"
}
};
using var request = new HttpRequestMessage(
HttpMethod.Post,
"https://api.seermartech.cn/v3/backlinks/timeseries_summary/live"
);
request.Headers.Authorization =
new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");
request.Content = new StringContent(
JsonSerializer.Serialize(postData),
Encoding.UTF8,
"application/json"
);
var response = await httpClient.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine(result);
}
else
{
Console.WriteLine(
$"HTTP 错误:{(int)response.StatusCode},响应:{result}"
);
}
}
}响应示例
json
{
"version": "0.1.20230825",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0709 sec.",
"cost
## 实用场景
- 待补充具体业务场景