主题
Backlinks 过滤参数
本文说明 Backlinks API 可用的过滤参数,以及如何在请求中通过 filters 自定义筛选结果。 通过过滤规则,您可以返回符合业务条件的数据。使用过滤和排序规则不会额外收费;当前接口本身也不计费,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
接口说明
该接口用于获取 Backlinks API部可用的过滤字段列表。
请求方式: GET请求地址:
https://api.seermartech.cn/v3/backlinks/available_filters
返回结果为 JSON, tasks 数组 result 为当前可用于数据过滤的参数,并按端点分组。
响应结构
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | API 当前版本 |
status_code | integer | 局状态码,完整列表参考 /v3/appendix/errors |
status_message | string | 局提示信息,完整列表参考 /v3/appendix/errors |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总费用,单位 USD |
tasks_count | integer | tasks 数组中的任务数 |
tasks_error | integer | 返回错误的任务数 |
tasks | array | 任务数组 |
tasks[].id | string | 任务唯一标识,UUID 格式 |
tasks[].status_code | integer | 任务状态码,范围通常为 10000-60000,完整列表参考 /v3/appendix/errors |
tasks[].status_message | string | 任务提示信息,完整列表参考 /v3/appendix/errors |
tasks[].time | string | 任务执行耗时,单位秒 |
tasks[].cost | float | 单任务费用,单位 USD |
tasks[].result_count | integer | result 数组数量 |
tasks[].path | array | URL 路径 |
tasks[].data | object | GET 请求 URL 中传的参数 |
tasks[].result | array | 可用于数据过滤的字段列表,按端点分组 |
获取过滤字段列表示例
curl
bash
curl -X GET "https://api.seermartech.cn/v3/backlinks/available_filters" \
-H "Authorization: Bearer smt_live_YOUR_KEY"Python
python
import requests
url = "https://api.seermartech.cn/v3/backlinks/available_filters"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY"
}
response = requests.get(url, headers=headers)
print(response.json)TypeScript
typescript
const response = await fetch("https://api.seermartech.cn/v3/backlinks/available_filters", {
method: "GET",
headers: {
"Authorization": "Bearer smt_live_YOUR_KEY"
}
});
const data = await response.json;
console.log(data);响应示例
json
{
"version": "0.1.20240801",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0573 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "backlinks",
"function": "available_filters"
},
"result": []
}
]
}filters 的使用规则
filters 是结果过滤条件数组,支持在大多数 Backlinks POST 接口中使用。
基本格式
filters 的结构为:
json
[
["字段名", "操作符", "值"],
"and",
["字段名", "操作符", "值"]
]规则说明
- 最多可添加 8 个过滤条件
- 多个条件之间使用逻辑运算符:
andorfiltered_field须填写当前端点支持的字段filter_value的类型与字段类型匹- 使用
in/not_in时,filter_value须是数组 regex/not_regex使用 RE2 语法,字符串长度上限为 1000 字符like/not_like建议合%使用,以获得准确匹结果- 时间类型字段应使用格式:
yyyy-mm-dd hh-mm-ss +00:00例如:2021-01-29 15:02:37 +00:00
通用操作符
| 字段类型 | 支持的操作符 |
|---|---|
bool | =, <> |
num | <, <=, >, >=, =, <>, in, not_in |
str | match, not_match, like, not_like, ilike, not_ilike, in, not_in, =, <>, regex, not_regex |
array.str | has, has_not |
array.num | has, has_not |
time | <, >, <=, >=, =, <>, in, not_in |
特殊说明
1)$key 的含义
在以下端点中,过滤字段中的 $key 表示 POST 请求体 targets 数组中的目标序号:
/v3/backlinks/domain_intersection/live/v3/backlinks/page_intersection/live
例如,若 targets 中某个页面排在第 2 位,则对应过滤字段形式为:
2.domain_from2.url_from2.referring_links_tld.com
2)$empty 字段
在以下端点中,referring_links_semantic_locations 数组里可能出现空标题字段,但它们仍可用于过滤:
/v3/backlinks/anchors/live/v3/backlinks/domain_pages/live/v3/backlinks/domain_intersection/live
这类字段统一写作 $empty,类型为 num。例如:
json
["referring_links_semantic_locations.$empty", ">", 0]3)按顶级域名(TLD)过滤
以下端点支持基于响应中的 referring_links_tld 对象按任意 TLD 过滤,但字段路径有所不同:
在以下端点使用
referring_links_tld.$tld/v3/backlinks/anchors/live/v3/backlinks/referring_domains/live/v3/backlinks/referring_networks/live/v3/backlinks/domain_pages_summary/live在
/v3/backlinks/domain_pages/live中使用:page_summary.referring_links_tld.$tld在
/v3/backlinks/domain_intersection/live中使用:$key.referring_links_tld.$tld
$tld 需替换为顶级域名,例如 com、org、net。例如:
json
["referring_links_tld.com", ">", 10]注意:referring_links_tld.$tld 可用于 filters,不能用于 order_by 排序。
Backlinks 端点可用过滤字段
以下字段适用于:
/v3/backlinks/backlinks/live
| 字段名 | 类型 | 说明 | 支持操作符 |
|---|---|---|---|
domain_from | str | 指向目标域名或页面的来源域名 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
url_from | str | 发现反向链接的来源页面 URL | 同上 |
url_from_https | bool | 来源 URL 是否为 HTTPS | =, <> |
domain_to | str | 反向链接指向的目标域名 | 同上 |
url_to | str | 反向链接指向的目标 URL | 同上 |
url_to_https | bool | 目标 URL 是否为 HTTPS | =, <> |
tld_from | str | 来源 URL 的顶级域名 | 同上 |
is_new | bool | 是否为新发现的反向链接 | =, <> |
is_lost | bool | 是否为已丢失的反向链接 | =, <> |
backlink_spam_score | num | 反向链接垃圾分数 | <, <=, >, >=, =, <>, in, not_in |
rank | num | 反向链接权重值 | 同上 |
page_from_rank | num | 来源页面权重值 | 同上 |
domain_from_rank | num | 来源域名权重值 | 同上 |
domain_from_platform_type | array.str | 来源域名的平台类型 | has |
domain_from_is_ip | bool | 来源域名是否为 IP | =, <> |
domain_from_ip | str | 来源域名 IP 地址 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
page_from_external_links | num | 来源页面外链数量 | <, <=, >, >=, =, <>, in, not_in |
page_from_internal_links | num | 来源页面链数量 | 同上 |
page_from_size | num | 来源页面大小,单位字节 | 同上 |
page_from_encoding | str | 来源页面字符编码 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
page_from_language | str | 来源页面语言 | 同上 |
page_from_title | str | 来源页面标题 | 同上 |
page_from_status_code | num | 来源页面返回的 HTTP 状态码 | <, <=, >, >=, =, <>, in, not_in |
first_seen | time | 首次发现该反向链接的时间,ISO 8601 | <, <=, >, >=, =, <>, in, not_in |
prev_seen | time | 最近一次之前的访问时间,ISO 8601 | 同上 |
last_seen | time | 最近一次访问该反向链接的时间,ISO 8601 | 同上 |
item_type | str | 链接类型,可选 anchor、image、meta、canonical、alternate、redirect | =, <>, like, not_like, ilike, not_ilike, match, not_match |
dofollow | bool | 是否为 dofollow | =, <> |
original | bool | 首次抓取来源页时该链接是否已存在 | =, <> |
alt | str | 图片替代文本 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
anchor | str | 锚文本 | 同上 |
text_pre | str | 锚文本前的文本片段 | 同上 |
text_post | str | 锚文本后的文本片段 | 同上 |
semantic_location | str | 链接所在 HTML 语义位置 | 同上 |
links_count | num | 来源页中相同反向链接的数量 | <, <=, >, >=, =, <>, in, not_in |
group_count | num | 该域名下指向目标的反向链接总数 | 同上 |
is_broken | bool | 反向链接是否失效 | =, <> |
url_to_status_code | num | 目标页状态码 | <, <=, >, >=, =, <>, in, not_in |
url_to_spam_score | num | 目标页垃圾分数 | <, <=, >, >=, =, <>, in, not_in |
Page Intersection 端点可用过滤字段
以下字段适用于:
/v3/backlinks/page_intersection/live
此端点中的大部分字段都以 $key. 开头,表示 targets 数组中某个目标页面的序号。
| 字段名 | 类型 | 说明 | 支持操作符 |
|---|---|---|---|
$key.domain_from | str | 指向目标页面的来源域名 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.url_from | str | 来源页面 URL | 同上 |
$key.url_from_https | bool | 来源 URL 是否为 HTTPS | =, <> |
$key.domain_to | str | 链接指向的目标域名 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.url_to | str | 链接指向的目标 URL | 同上 |
$key.url_to_https | bool | 目标 URL 是否为 HTTPS | =, <> |
$key.tld_from | str | 来源 URL 顶级域名 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.is_new | bool | 是否为新反向链接 | =, <> |
$key.is_lost | bool | 是否为已丢失反向链接 | =, <> |
$key.backlink_spam_score | num | 反向链接垃圾分数 | <, <=, >, >=, =, <>, in, not_in |
$key.rank | num | 反向链接权重值 | 同上 |
$key.page_from_rank | num | 来源页面权重值 | 同上 |
$key.domain_from_rank | num | 来源域名权重值 | 同上 |
domain_from_platform_type | array.str | 来源域名平台类型 | has |
$key.domain_from_is_ip | bool | 来源域名是否为 IP | =, <> |
$key.domain_from_ip | str | 来源域名 IP 地址 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.page_from_external_links | num | 来源页外链数量 | <, <=, >, >=, =, <>, in, not_in |
$key.page_from_internal_links | num | 来源页链数量 | 同上 |
$key.page_from_size | num | 来源页大小,单位字节 | 同上 |
$key.page_from_encoding | str | 来源页字符编码 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.page_from_language | str | 来源页语言 | 同上 |
$key.page_from_title | str | 来源页标题 | 同上 |
$key.page_from_status_code | num | 来源页 HTTP 状态码 | <, <=, >, >=, =, <>, in, not_in |
$key.first_seen | time | 首次发现时间,ISO 8601 | <, <=, >, >=, =, <>, in, not_in |
$key.prev_seen | time | 最近访问前一次的时间,ISO 8601 | 同上 |
$key.last_seen | time | 最近访问时间,ISO 8601 | 同上 |
$key.item_type | str | 链接类型,可选 anchor、image、link、meta、canonical、alternate、redirect | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.dofollow | bool | 是否为 dofollow | =, <> |
$key.original | bool | 首次抓取时是否已存在 | =, <> |
$key.alt | str | 图片替代文本 | =, <>, like, not_like, ilike, not_ilike, match, not_match |
$key.anchor | str | 锚文本 | 同上 |
$key.text_pre | str | 锚文本前文本 | 同上 |
$key.text_post | str | 锚文本后文本 | 同上 |
$key.semantic_location | str | 链接所在 HTML 语义位置 | 同上 |
$key.links_count | num | 来源页中相同反向链接数量 | <, <=, >, >=, =, <>, in, not_in |
$key.group_count | num | 该来源域名下反向链接总数 | 同上 |
$key.is_broken | bool | 是否失效 | =, <> |
$key.url_to_status_code | num | 目标页状态码 | <, <=, >, >=, =, <>, in, not_in |
$key.url_to_spam_score | num | 目标页垃圾分数 | <, <=, >, >=, =, <>, in, not_in |
filters 示例
示例 1:筛选 HTTPS 且 dofollow 的反向链接
json
[
{
"target": "example.com",
"filters": [
["url_from_https", "=", true],
"and",
["dofollow", "=", true]
]
}
]示例 2:筛选锚文本 seo 的数据
json
[
{
"target": "example.com",
"filters": [
["anchor", "like", "%seo%"]
]
}
]示例 3:筛选垃圾分数低于 30 且来源域名权重大于 50
json
[
{
"target": "example.com",
"filters": [
["backlink_spam_score", "<", 30],
"and",
["domain_from_rank", ">", 50]
]
}
]示例 4:Page Intersection 中按第 2 个目标页面过滤
json
[
{
"targets": [
"https://example.com/page-a",
"https://example.com/page-b"
],
"filters": [
["2.anchor", "like", "%brand%"],
"and",
["2.dofollow", "=", true]
]
}
]错误码
接口和任务级状态码、通用提示信息请参考:
/v3/appendix/errors
通常可重点以下字段:
- 顶层:
status_code、status_message - 任务级:
tasks[].status_code、tasks[].status_message
使用建议
- 调用
/v3/backlinks/available_filters获取某一时期支持的过滤字段 - 若过滤条件较复杂,建议单条件验证,再逐步组合
and/or - 文本匹优使用
like/ilike;需要更复杂模式时再使用regex - 涉及交集类端点时,务确认
$key对应的是targets中的第几个目标 - 对时间字段筛选时,统一使用 UTC 时间格式,结果偏差
实用场景
- 筛选高质量外链:按
dofollow、domain_from_rank、backlink_spam_score组合过滤,快速锁定值得跟进或复用的优质外链资源。 - 识别新获与流失外链:通过
is_new、is_lost、first_seen、last_seen监控外链变化,帮助 SEO 团队评估投放、传播和链接维护效果。 - 洗低价值来源:过滤 IP 站点、低质量 TLD、异常状态码页面,减少噪音数据,提升外链分析准确度。
- 分析竞品交集外链:在
/v3/backlinks/page_intersection/live中结合$key.*字段筛选多个目标页面的来源,挖掘可复制的外链机会。 - 定位特定锚文本策略:按
anchor、text_pre、text_post、semantic_location过滤,研究品牌词、商业词或上下文中的链接布局方式。