主题
Domain Intersection(旧版)
GET /v3/dataforseo_labs/locations_and_languages
本接口使用 POST 方法,路径为:
/v3/dataforseo_labs/domain_intersection/live
Domain Intersection 用于分析两个指定域名在同一 SERP 中排名的。接口可返回搜索量、竞争度、每次点击费用(CPC)、展示次数,以及两个域名分别对应的 SERP素、预估流量和广告流量成本。
本接口支持以下 SERP 类型:
- 自然结果(
organic) - 付费结果(
paid) - 本地结果(
local_pack) - 精选摘要(
featured_snippet)
> 本页面为旧版接口文档。新版接口的请求和响应结构有所调整,但旧版路径仍可继续使用。
计费与请求限制
- 每次请求按任务计费。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。 - 请求体使用 UTF-8 编码的 JSON 格式。
- POST 请求体是 JSON 数组,即
[{ ... }]。 平台限流以认证说明中的 30/60/120 次/分钟规则为准。 - 可通过
limit、offset、filters和order_by控制返回结果。
请求参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
target1 | string | 是 | 第一个目标域名。不得 https:// 和 www.,例如 mom.me。 |
target2 | string | 是 | 第二个目标域名。不得 https:// 和 www.,例如 quora.com。 |
location_name | string | 条件填 | 地区名。当未指定 location_code 时填。在 location_name 和 location_code 中二选一。 |
location_code | integer | 条件填 | 地区代码。当未指定 location_name 时填。在 location_name 和 location_code 中二选一。 |
language_name | string | 条件填 | 语言名。当未指定 language_code 时填。在 language_name 和 language_code 中二选一。 |
language_code | string | 条件填 | 语言代码。当未指定 language_name 时填。在 language_name 和 language_code 中二选一。 |
intersections | boolean | 否 | 是否返回两个域名在同一 SERP 中同时出现的。默认值为 true。设为 false 时,返回 target1 有排名而 target2 没有排名的。 |
item_types | array | 否 | 限制返回的搜索结果类型。可传 SERP素类型数组。 |
include_serp_info | boolean | 否 | 是否为每个返回 SERP 信息。设为 true 时返回 serp_info;默认值为 false。 |
limit | integer | 否 | 最大返回数量。默认 100,最大 1000。 |
offset | integer | 否 | 结果偏移量,默认 0。例如设置为 10,将跳过前 10 个结果。 |
filters | array | 否 | 结果过滤条件,最多设置 8 个过滤器。多个条件之间使用 and 或 or。 |
order_by | array | 否 | 结果排序规则。最多设置 3 条规则,支持 asc 和 desc。 |
tag | string | 否 | 自定义任务标识,最长 255 个字符。该值会原样出现在响应 data 对象中。 |
地区与语言
可通过以下接口查询可用的地区和语言:
GET /v3/dataforseo_labs/locations_and_languages
示例值:
| 参数 | 示例 |
|---|---|
location_name | United Kingdom |
location_code | 2840 |
language_name | English |
language_code | en |
intersections 参数说明
当 intersections 为 true 时:
- 返回两个域名在同一 SERP 中均有结果的。
first_domain_serp_element和second_domain_serp_element均可能返回对应的 SERP素。- 如果交集 1000 万条,接口不会返回结果。
当 intersections 为 false 时:
- 返回
target1有排名、target2没有排名的。 - 返回
target1对应的 SERP素和数据。
过滤器
支持以下运算符:
<、<=、>、>=、=、<>、in、not_in、like、not_like
like 和 not_like 支持使用 % 匹任意长度的字符串。
示例:
json
[
{
"target1": "mom.me",
"target2": "quora.com",
"location_code": 2840,
"language_code": "en",
"filters": [
[
"first_domain_serp_element.etv",
">",
0
],
"and",
[
"first_domain_serp_element.description",
"like",
"%goat%"
]
],
"limit": 5
}
]请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/dataforseo_labs/domain_intersection/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"target1": "mom.me",
"target2": "quora.com",
"location_name": "United States",
"language_name": "English",
"intersections": true,
"include_serp_info": true,
"filters": [
[
"first_domain_serp_element.etv",
">",
0
],
"and",
[
"first_domain_serp_element.description",
"like",
"%goat%"
]
],
"limit": 5
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/domain_intersection/live"
payload = [
{
"target1": "mom.me",
"target2": "quora.com",
"location_name": "United States",
"language_name": "English",
"intersections": True,
"filters": [
["first_domain_serp_element.etv", ">", 0],
"and",
["first_domain_serp_element.description", "like", "%goat%"]
],
"limit": 5
}
]
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,错误码:%s,错误信息:%s"
% (result.get("status_code"), result.get("status_message"))
)TypeScript
typescript
import axios from "axios";
const payload = [
{
target1: "mom.me",
target2: "quora.com",
location_name: "United States",
language_name: "English",
intersections: true,
filters: [
["first_domain_serp_element.etv", ">", 0],
"and",
["first_domain_serp_element.description", "like", "%goat%"]
],
limit: 5
}
];
axios.post(
"https://api.seermartech.cn/v3/dataforseo_labs/domain_intersection/live",
payload,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
}
).then(({ data }) => {
if (data.status_code === 20000) {
console.log(data);
} else {
console.error(
`请求失败,错误码:${data.status_code},错误信息:${data.status_message}`
);
}
}).catch((error) => {
console.error("网络或接口请求异常:", error);
});响应结构
接口返回 JSON 对象 tasks 数组。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。20000 表示成功。 |
status_message | string | 请求级状态信息。 |
time | string | 请求执行耗时,例如 1.6172 sec.。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | 执行失败的任务数量。 |
tasks | array | 任务结果数组。 |
任务字段
| 字段 | 类型 | 说明 |
|---|---|---|
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 字段
| 字段 | 类型 | 说明 |
|---|---|---|
target1 | string | 请求中的第一个目标域名。 |
target2 | string | 请求中的第二个目标域名。 |
location_code | integer | 请求中的地区代码。 |
language_code | string | 请求中的语言代码。 |
total_count | integer | 数据库中符合条件的结果总数。 |
items_count | integer | 本次 items 数组返回的结果数量。 |
items | array | 、SERP素及数据。 |
items 字段
keyword_data
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的。 |
location_code | integer | 对应的地区代码。 |
language_code | string | 对应的语言代码。 |
keyword_info | object | 指标数据。 |
impressions_info | object | 展示次数及广告估算数据。 |
bing_keyword_info | object | 基于 Bing Ads 的数据,部分地区和语言可能为空。 |
serp_info | object/null | SERP 数据。未设置 include_serp_info: true 或没有可用数据时为 null。 |
keyword_info
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 数据更新时间,UTC 格式,例如 2019-11-15 12:57:46 +00:00。 |
competition | float | 竞争度,取值范围为 0 至 1。 |
cpc | float | 历史平均每次点击费用。 |
search_volume | integer | 平均月搜索量。 |
categories | array | 产品和服务类别。 |
monthly_searches | array | 过去 12 个月的月度搜索量。每项通常 year、month 和 search_volume。 |
impressions_info
展示次数数据基于最高出价 999 计算,用于降低账户级因素对估算结果的影响,通常可作为搜索量数据的补参考。
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 展示次数数据更新时间。 |
bid | integer | 最高 CPC 出价。接口通常使用 999。 |
match / match_type | string | 匹类型,可为 exact、broad 或 phrase。 |
ad_position_min | float | 最低广告位置。 |
ad_position_max | float | 最高广告位置。 |
ad_position_average | float | 平均广告位置。 |
cpc_min | float | 以 999 出价估算的最低 CPC。不是 CPC。 |
cpc_max | float | 以 999 出价估算的最高 CPC。不是 CPC。 |
cpc_average | float | 以 999 出价估算的平均 CPC。不是 CPC。 |
daily_impressions_min | float | 预计最低日展示次数。 |
daily_impressions_max | float | 预计最高日展示次数。 |
daily_impressions_average | float | 预计平均日展示次数。 |
daily_clicks_min | float | 预计最低日点击次数。 |
daily_clicks_max | float | 预计最高日点击次数。 |
daily_clicks_average | float | 预计平均日点击次数。 |
daily_cost_min | float | 预计最低日广告费用。 |
daily_cost_max | float | 预计最高日广告费用。 |
daily_cost_average | float | 预计平均日广告费用。 |
> cpc_min、cpc_max 和 cpc_average 是基于出价 999 的估算值,不代表的 CPC。 CPC 应查看 keyword_info.cpc。
bing_keyword_info
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | Bing 数据更新时间。 |
search_volume | integer | Bing 月搜索量。 |
monthly_searches | array | 指定地区下的 Bing 月度搜索量。 |
serp_info
当 include_serp_info 为 true 且存在 SERP 数据时返回。
| 字段 | 类型 | 说明 |
|---|---|---|
check_url | string | 对应的搜索结果页 URL,可用于核验结果。 |
serp_item_types | array | SERP 中出现的结果类型。 |
se_results_count | string | 搜索结果数量。 |
keyword_difficulty | integer | 难度,取值范围为 0 至 100,用于表示自然结果前十名的难度。 |
last_updated_time | string | SERP 数据最近更新时间。 |
previous_updated_time | string | SERP 数据上一次更新时间。 |
serp_item_types 可能:
answer_box、app、carousel、multi_carousel、featured_snippet、google_flights、google_reviews、images、jobs、knowledge_graph、local_pack、map、organic、paid、people_also_ask、related_searches、people_also_search、shopping、top_stories、twitter、video、events、mention_carousel、recipes、top_sights、scholarly_articles、popular_products、podcasts、questions_and_answers、find_results_on、stocks_box。
SERP素数据主要在以下类型中返回:
organicpaidfeatured_snippetlocal_pack
域名 SERP素
每条结果可:
| 字段 | 类型 | 说明 |
|---|---|---|
first_domain_serp_element | object | 第一个域名对应的 SERP素。 |
second_domain_serp_element | object | 第二个域名对应的 SERP素。 |
通用 SERP 字段
以下字段可能出现在 organic、paid、local_pack 和 featured_snippet素中:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | SERP素类型。 |
rank_group | integer | 同类型中的排名。不同类型不会计该排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
position | string | 素在页面中的位置,可为 left 或 right。 |
xpath | string | 素在页面中的 XPath。 |
domain | string | SERP 中显示的域名或子域名。 |
title | string | 结果标题。 |
url | string | 结果 URL。 |
main_domain | string | SERP 中的主域名。 |
relative_url | string | 不协议和域名的相对 URL。 |
description | string | 结果描述。 |
highlighted | array | 描述中以粗体突出显示的词语。 |
etv | float | 预估自然月流量,通常按点击率 × 搜索量计算。 |
impressions_etv | float | 基于展示次数估算的月流量,通常按点击率 × 展示次数计算。 |
estimated_paid_traffic_cost | float | 将估算自然流量转化为付费流量所需的月度广告成本估算值。 |
rank_changes | object | 自上次更新时间以来的排名变化。 |
organic素专属字段
| 字段 | 类型 | 说明 |
|---|---|---|
breadcrumb | string | 面屑路径。 |
is_image | boolean | 是否图片。 |
is_video | boolean | 是否视频。 |
is_featured_snippet | boolean | 是否为精选摘要。 |
is_malicious | boolean | 是否被标记为恶意结果。 |
pre_snippet | string | 出现在描述前的附加信息。 |
extended_snippet | string | 出现在描述后的扩展信息。 |
amp_version | boolean | 是否存在 AMP 版本。 |
rating | object/null | 结果评分。 |
links | array/null | 站点链接。没有站点链接时为 null。 |
about_this_result | object/null | “此结果”面板中的附加信息。 |
paid素专属字段
| 字段 | 类型 | 说明 |
|---|---|---|
breadcrumb | string | 广告面屑。 |
extra | array | 广告结果的附加信息。 |
ad_aclk | string | 广告标识符。 |
description_rows | array/null | 扩展广告描述。没有时为 null。 |
links | array/null | 广告站点链接。 |
estimated_paid_traffic_cost | float | 基于 etv 和 cpc 估算的付费月流量成本。 |
付费结果中的链接通常:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 ad_link_element。 |
title | string | 链接标题。 |
description | string | 链接描述。 |
url | string | 链接 URL。 |
ad_aclk | string | 广告标识符。 |
local_pack素专属字段
| 字段 | 类型 | 说明 |
|---|---|---|
phone | string | 电话号码。 |
is_paid | boolean | 是否为广告结果。 |
rating | array/object | 本地结果评分。 |
rating_type | string | 评分类型,可为 Max5、Percents 或 CustomMax。 |
value | integer | 评分值。 |
votes_count | integer | 评价数量。 |
rating_max | integer | 评分类型对应的最大值。 |
featured_snippet素专属字段
| 字段 | 类型 | 说明 |
|---|---|---|
featured_title | string | 精选摘要来源页面的标题。 |
table | array/null | 精选摘要中的表格。没有时为 null。 |
table_header | array | 表格列名。 |
table_content | array | 表格,每个代表一行。 |
评分字段 rating
| 字段 | 类型 | 说明 |
|---|---|---|
rating_type | string | 评分类型:Max5、Percents 或 CustomMax。 |
value | integer | 评分值。 |
votes_count | integer | 评价数量。 |
rating_max | integer | 评分最大值。 |
about_this_result
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 about_this_result_element。 |
url | string | 结果 URL。 |
source | string | 附加信息来源。 |
source_info | string | 来源提供的补说明。 |
source_url | string | 来源信息的完整 URL。 |
language | string | 结果语言。 |
location | string | 结果对应的地区。 |
search_terms | array | 结果中匹的搜索词。 |
related_terms | array | 搜索词。 |
rank_changes
| 字段 | 类型 | 说明 |
|---|---|---|
previous_rank_absolute | integer/null | 上一次检查时的绝对排名。新出现的为 null。 |
is_new | boolean | 是否为新出现的 SERP素。 |
is_up | boolean | 排名是否上升。 |
is_down | boolean | 排名是否下降。 |
响应示例
json
{
"version": "0.1.20201204",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.6172 sec.",
"cost": 0.0102,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.5321 sec.",
"cost": 0.0102,
"result_count": 1,
"path": [
"v3",
"dataforseo_labs",
"domain_intersection",
"live"
],
"data": {
"api": "dataforseo_labs",
"function": "domain_intersection",
"target1": "mom.me",
"target2": "quora.com",
"language_name": "English",
"location_code": 2840,
"include_serp_info": true,
"limit": 2,
"intersections": true
},
"result": [
{
"target1": "mom.me",
"target2": "quora.com",
"location_code": 2840,
"language_code": "en",
"total_count": 2,
"items_count": 2,
"items": [
{
"keyword_data": {
"keyword": "find my phone",
"location_code": 2840,
"language_code": "en",
"keyword_info": {
"last_updated_time": "2021-01-18 14:12:40 +00:00",
"competition": 0.0571,
"cpc": null,
"search_volume": 10,
"categories": null,
"monthly_searches": []
},
"impressions_info": {
"last_updated_time": "2021-01-18 14:12:40 +00:00",
"bid": 999,
"match": "exact",
"ad_position_min": null,
"ad_position_max": null,
"ad_position_average": null,
"cpc_min": null,
"cpc_max": null,
"cpc_average": null,
"daily_impressions_min": null,
"daily_impressions_max": null,
"daily_impressions_average": null,
"daily_clicks_min": null,
"daily_clicks_max": null,
"daily_clicks_average": null,
"daily_cost_min": null,
"daily_cost_max": null,
"daily_cost_average": null
},
"bing_keyword_info": {
"last_updated_time": "2021-01-18 14:12:40 +00:00",
"search_volume": null,
"monthly_searches": []
},
"serp_info": {
"check_url": "https://www.google.com/search?q=find%20my%20phone",
"serp_item_types": [
"organic",
"paid",
"people_also_ask"
],
"se_results_count": 14920000000,
"keyword_difficulty": 47,
"last_updated_time": "2021-03-14 12:34:40 +00:00",
"previous_updated_time": "2021-03-14 20:20:35 +00:00"
}
},
"first_domain_serp_element": {
"type": "organic",
"rank_group": 11,
"rank_absolute": 13,
"position": "left",
"domain": "mom.me",
"title": "Example result",
"url": "https://mom.me/example",
"main_domain": "mom.me",
"relative_url": "/example",
"etv": 0.021,
"impressions_etv": null,
"estimated_paid_traffic_cost": null,
"rank_changes": {
"previous_rank_absolute": 40,
"is_new": false,
"is_up": false,
"is_down": true
}
},
"second_domain_serp_element": {
"type": "organic",
"rank_group": 5,
"rank_absolute": 7,
"position": "left",
"domain": "quora.com",
"title": "Example result",
"url": "https://www.quora.com/example",
"main_domain": "quora.com",
"relative_url": "/example",
"etv": 0.091,
"impressions_etv": null,
"estimated_paid_traffic_cost": null,
"rank_changes": {
"previous_rank_absolute": 10,
"is_new": false,
"is_up": true,
"is_down": false
}
}
}
]
}
]
}
]
}错误处理
请同时检查以下状态字段:
- 顶层
status_code - 任务级
status_code - 顶层
status_message - 任务级
status_message tasks_error
当状态码不为 20000 时,应根据错误码和状态信息进行重试、修正参数或记录失败任务。完整错误码请参考本平台错误码文档。
实用场景
- 发现竞争对手覆盖的:识别两个域名同时排名的搜索词,定位双方争夺的主题和流量。
- 挖掘差距:将
intersections设为false,查找目标站点已排名而竞争对手未排名的,优扩展竞争优势页面。 - 评估商业价值:结合
search_volume、competition、cpc和estimated_paid_traffic_cost,筛选适合 SEO 与付费投放协同布局的。 - 比较 SERP 排名表现:对比
first_domain_serp_element和second_domain_serp_element的rank_absolute、etv与rank_changes,跟踪双方排名和流量变化。 - 分析 SERP 展现机会:通过
serp_info.serp_item_types判断是否精选摘要、本地结果或广告位,为结构和 SERP 特性优化提供依据。