主题
竞争域名(旧版)
接口说明
POST /v3/dataforseo_labs/competitors_domain/live
该接口用于获取目标域名在自然搜索与付费搜索中的竞争域名概览,并返回双方在同一 SERP 中排名的交集指标。
除竞争域名列表外,响应还会提供:
- 竞争域名在量维度下的排名与流量指标
- 目标域名与竞争域名覆盖的交集指标
- 目标域名在交集上的指标
- 竞争域名在交集上的指标
说明:该接口为旧版(Legacy)结构。本平台仍容该版本;如需使用新版结构,请参考对应新版接口文档。
请求地址
bash
POST https://api.seermartech.cn/v3/dataforseo_labs/competitors_domain/live计费与限频
- 按请求计费
- 参考价请以游结算为准,扣费以响应头
X-SeerMarTech-Charge-CNY为准 - 请求体为 UTF-8 编码的 JSON
- POST 请求体格式为 JSON 数组:
[{ ... }] - 最高请求频率:2000 次/分钟
- 支持通过
limit、offset、filters、order_by控制返回结果
请求参数
以下为任务对象字段说明,即 JSON 数组中每个对象可填写的参数。
| 字段名 | 类型 | 说明 |
|---|---|---|
target | string | 填。目标网站域名,不要 https:// 和 www. |
location_name | string | 地区完整名称。未指定 location_code 时填。location_name 和 location_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区,例如 United Kingdom |
location_code | integer | 地区代码。未指定 location_name 时填。location_name 和 location_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取,例如 2840 |
language_name | string | 语言完整名称。未指定 language_code 时填。language_name 和 language_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取,例如 English |
language_code | string | 语言代码。未指定 language_name 时填。language_name 和 language_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取,例如 en |
item_types | array | 可选。指定返回的搜索结果类型。若数组中非 organic 类型,结果会按数组中的第一个类型排序;且不能按未在响应中的结果类型进行排序或过滤 |
filters | array | 可选。结果过滤条件数组,最多 8 个过滤条件。条件之间需使用逻辑运算符 and / or 连接。支持操作符:<、<=、>、>=、=、<>、in、not_in |
order_by | array | 可选。排序规则。可使用与 filters 相同的字段路径。排序方式支持 asc 和 desc。单次请求最多设置 3 条排序规则 |
limit | integer | 可选。返回域名数量上限。默认 100,最大 1000 |
offset | integer | 可选。结果偏移量。默认 0。例如设置为 10 时,将跳过前 10 条结果 |
max_rank_group | integer | 可选。识别竞争对手时考虑的最大排名范围。默认 100。例如设置为 10,则只从 Google 前 10 名结果中提取竞争域名 |
exclude_top_domains | boolean | 可选。是否排除大型站点。默认 false。设置为 true 后,将排除如下高权重通用站点,以便获得更的竞争域名 |
intersecting_domains | array | 可选。补已知与 target 在 SERP 中存在交集的域名,以提高结果准确性。若使用该参数,结果指标将基于 target 与这些域名出现的 SERP 计算。最多支持 20 个域名 |
tag | string | 可选。用户自定义任务标识,最长 255 字符。可用于结果回传时匹业务任务 |
exclude_top_domains=true 时排除的站点
wikipedia.orgpinterest.comamazon.comgoogle.comfacebook.comwordpress.commedium.comquora.comreddit.comyoutube.comebay.comuol.com.brinstagram.comolx.comtwitter.comlinkedin.comslideshare.net
过滤与排序说明
支持的过滤操作符
<<=>>==<>innot_in
过滤示例
下面示例表示:
- 满足
metrics.organic.count >= 50且metrics.organic.pos_1属于[1,2,3] - 或
metrics.organic.etv >= 100
json
[
[
["metrics.organic.count", ">=", 50],
"and",
["metrics.organic.pos_1", "in", [1, 2, 3]]
],
"or",
["metrics.organic.etv", ">=", 100]
]排序示例
json
[
["metrics.organic.etv", "desc"],
["intersections", "desc"]
]注意:
- 单次请求最多设置 3 条排序规则
- 如果
item_types中非organic类型,结果会按item_types数组中的第一个类型排序
请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/dataforseo_labs/competitors_domain/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"target": "example.com",
"language_name": "English",
"location_code": 2840,
"filters": [
[
["metrics.organic.count", ">=", 50],
"and",
["metrics.organic.pos_1", "in", [1, 2, 3]]
],
"or",
["metrics.organic.etv", ">=", 100]
],
"limit": 5
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/competitors_domain/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
data = [
{
"target": "example.com",
"location_name": "United States",
"language_name": "English",
"filters": [
[
["metrics.organic.count", ">=", 50],
"and",
["metrics.organic.pos_1", "in", [1, 2, 3]]
],
"or",
["metrics.organic.etv", ">=", 100]
],
"limit": 5
}
]
response = requests.post(url, headers=headers, json=data)
print(response.json)TypeScript
typescript
import axios from "axios";
const postData = [
{
target: "example.com",
language_name: "English",
location_code: 2840,
filters: [
[
["metrics.organic.count", ">=", 50],
"and",
["metrics.organic.pos_1", "in", [1, 2, 3]]
],
"or",
["metrics.organic.etv", ">=", 100]
],
limit: 5
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/dataforseo_labs/competitors_domain/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: postData
}).then((response) => {
console.log(response.data);
}).catch((error) => {
console.error(error);
});响应结构
接口返回 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 | 任务 ID,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时 |
cost | float | 任务成本,单位 USD |
result_count | integer | result 数组数 |
path | array | URL 路径 |
data | object | 回显请求参数 |
result | array | 结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
target | string | 请求中的目标域名 |
location_code | integer | 请求中的地区代码 |
language_code | string | 请求中的语言代码 |
total_count | integer | 数据库中与请求匹的结果总量 |
items_count | integer | items 数组返回条数 |
items | array | 竞争域名列表及指标 |
items[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
domain | string | 竞争域名 |
avg_position | integer | 域名在 SERP 中的平均排名。基于交集计算;同一域名与不同目标域名组合时,该值可能不同 |
sum_position | integer | 域名在 SERP 中的排名总和。基于交集计算;同一域名与不同目标域名组合时,该值可能不同 |
intersections | integer | 交集数量 |
full_domain_metrics | object | 该域名在****维度下的指标 |
metrics | object | 该域名与目标域名交集维度下,目标域名的指标 |
competitor_metrics | object | 该域名与目标域名交集维度下,竞争域名的指标 |
指标对象说明
以下结构适用于:
full_domain_metricsmetricscompetitor_metrics
这些对象都可能以下结果类型:
organicpaidlocal_packfeatured_snippet
各结果类型下的通用字段
| 字段名 | 类型 | 说明 |
|---|---|---|
pos_1 | integer | 排名第 1 的 SERP 数量 |
pos_2_3 | integer | 排名第 2-3 的 SERP 数量 |
pos_4_10 | integer | 排名第 4-10 的 SERP 数量 |
pos_11_20 | integer | 排名第 11-20 的 SERP 数量 |
pos_21_30 | integer | 排名第 21-30 的 SERP 数量 |
pos_31_40 | integer | 排名第 31-40 的 SERP 数量 |
pos_41_50 | integer | 排名第 41-50 的 SERP 数量 |
pos_51_60 | integer | 排名第 51-60 的 SERP 数量 |
pos_61_70 | integer | 排名第 61-70 的 SERP 数量 |
pos_71_80 | integer | 排名第 71-80 的 SERP 数量 |
pos_81_90 | integer | 排名第 81-90 的 SERP 数量 |
pos_91_100 | integer | 排名第 91-100 的 SERP 数量 |
etv | float | 预估流量值。按 CTR × 搜索量计算的月度预估流量 |
impressions_etv | float | 基于量计算的预估流量值。按 CTR × impressions 计算 |
count | integer | 含该域名的对应类型 SERP 总数 |
estimated_paid_traffic_cost | float | 预估流量成本,单位 USD |
is_new | integer | 新增排名项数量 |
is_up | integer | 排名上升项数量 |
is_down | integer | 排名下降项数量 |
is_lost | integer | 丢失排名项数量 |
不同指标对象的含义
full_domain_metrics
表示返回的竞争域名在所有已排名上的量概览自然搜索、付费搜索、本地、精选摘要等维度。
metrics
表示在该竞争域名与 target 出现的集合下,目标域名的指标表现。
competitor_metrics
表示在该竞争域名与 target 出现的集合下,竞争域名的指标表现。
响应示例
json
{
"version": "0.1.20210622",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.7839 sec.",
"cost": 0.0105,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "8a7b8c2e-1f2a-4e98-9c49-1234567890ab",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.7612 sec.",
"cost": 0.0105,
"result_count": 1,
"path": [
"v3",
"dataforseo_labs",
"competitors_domain",
"live"
],
"data": {
"api": "dataforseo_labs",
"function": "competitors_domain",
"target": "example.com",
"language_name": "English",
"location_code": 2840,
"filters": [
[
["metrics.organic.count", ">=", 50],
"and",
["metrics.organic.pos_1", "in", [1, 2, 3]]
],
"or",
["metrics.organic.etv", ">=", 100]
],
"limit": 5
},
"result": [
{
"target": "example.com",
"location_code": 2840,
"language_code": "en",
"total_count": 5,
"items_count": 5,
"items": [
{
"domain": "competitor1.com",
"avg_position": 7,
"sum_position": 154,
"intersections": 86,
"full_domain_metrics": {
"organic": {
"pos_1": 12,
"pos_2_3": 34,
"pos_4_10": 120,
"pos_11_20": 96,
"pos_21_30": 71,
"pos_31_40": 55,
"pos_41_50": 48,
"pos_51_60": 36,
"pos_61_70": 29,
"pos_71_80": 20,
"pos_81_90": 15,
"pos_91_100": 10,
"etv": 1540.67,
"impressions_etv": 1843.22,
"count": 546,
"estimated_paid_traffic_cost": 320.14,
"is_new": 18,
"is_up": 72,
"is_down": 41,
"is_lost": 9
}
},
"metrics": {
"organic": {
"pos_1": 4,
"pos_2_3": 11,
"pos_4_10": 29,
"pos_11_20": 18,
"pos_21_30": 12,
"pos_31_40": 6,
"pos_41_50": 3,
"pos_51_60": 2,
"pos_61_70": 1,
"pos_71_80": 0,
"pos_81_90": 0,
"pos_91_100": 0,
"etv": 268.42,
"impressions_etv": 301.57,
"count": 86,
"estimated_paid_traffic_cost": 79.31,
"is_new": 5,
"is_up": 19,
"is_down": 8,
"is_lost": 2
}
},
"competitor_metrics": {
"organic": {
"pos_1": 6,
"pos_2_3": 13,
"pos_4_10": 27,
"pos_11_20": 17,
"pos_21_30": 11,
"pos_31_40": 5,
"pos_41_50": 4,
"pos_51_60": 2,
"pos_61_70": 1,
"pos_71_80": 0,
"pos_81_90": 0,
"pos_91_100": 0,
"etv": 295.84,
"impressions_etv": 332.16,
"count": 86,
"estimated_paid_traffic_cost": 91.44,
"is_new": 4,
"is_up": 16,
"is_down": 9,
"is_lost": 3
}
}
}
]
}
]
}
]
}错误处理
- 顶层
status_code表示整次请求状态 tasks[].status_code表示单个任务状态- 建议同时校验:
- HTTP 状态码
- 顶层
status_code - 任务级
tasks[].status_code
常见成功状态:
| 状态码 | 含义 |
|---|---|
20000 | 请求成功 |
更多错误码请参考 /v3/appendix/errors。
使用建议
- 如果需要更高性的竞争域名,建议设置
exclude_top_domains=true - 如果已知一批与目标域名经常同页出现的站点,可通过
intersecting_domains提高识别准确性 - 若主要头部竞争结果,可合
max_rank_group=10限定在前 10 名 SERP 范围 - 分页抓取大量竞争域名时,建议结合
limit与offset使用 - 若只分析某类 SERP,可使用
item_types限定结果类型
实用场景
- 识别核心自然搜索竞争对手:目标站点后返回 SERP 交集最高的竞争域名,帮助快速建立竞品池与监控名单
- 筛选高价值流量竞争域名:结合
filters过滤etv、count、pos_1等指标,优锁定有真实 SEO 流量价值的对手 - 对比目标站与竞品在交集词上的强弱:同时查看
metrics与competitor_metrics,定位双方在中的排名差距 - 排除大型平台站点干扰:启用
exclude_top_domains后聚焦垂直领域竞争,减少百科、电商、社媒平台对分析结果的污染 - 评估竞品自然流量替代成本:使用
estimated_paid_traffic_cost判断竞争域名当前自然流量如果改用 PPC 获取,理论上需要多少预算