主题
Bing 子域名排名与流量分析
GET /v3/dataforseo_labs/locations_and_languages
本接口使用 POST 方法,路径为:
/v3/dataforseo_labs/bing/subdomains/live
用于查询指定域名下的子域名,并返回在 Bing 自然搜索、付费搜索及搜索结果类型中的排名分布、预估流量和流量价值。
数据每周更新一次,最新更新时间可通过 /v3/dataforseo_labs/status/ 查询。
接口信息
- 请求地址:
https://api.seermartech.cn/v3/dataforseo_labs/bing/subdomains/live - 请求方法:
POST - 请求格式: JSON
- 认证方式: Bearer Token
- 单分钟请求上限: 2000 次
- 最大并发请求数: 30
- 单次最多返回结果: 1000 条
请求体是 JSON 数组,即使只提交一个任务,也需要使用以下格式:
json
[
{
"target": "example.com"
}
]计费说明
每次请求均会产生费用。参考价约 ¥0.07 / 次,价格可能根据接口版本和账户变化。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
任务参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
target | string | 是 | 目标域名。请勿 https:// 或 www.,例如 example.com。 |
location_name | string | 否 | 地区名称。传该参数后无需传 location_code。当前接口支持美国地区。示例:United States。 |
location_code | integer | 否 | 地区代码。传该参数后无需传 location_name。当前接口支持美国地区。示例:2840。 |
language_name | string | 否 | 语言名称。传该参数后无需传 language_code。示例:English。 |
language_code | string | 否 | 语言代码。传该参数后无需传 language_name。示例:en。 |
item_types | array | 否 | 指定返回的搜索结果类型。可选类型 organic、paid、featured_snippet 和 local_pack。如果数组中 organic 以外的类型,结果将数组中的第一种类型排序。未在数组中的结果类型不能用于筛选或排序。 |
historical_serp_mode | string | 否 | 数据采集范围。可选值:live:返回目标域名当前仍有排名的 SERP 数据;lost:返回目标域名曾有排名、但最近一次检查已消失的 SERP 数据;all:返回以上两类数据。默认值为 live。 |
ignore_synonyms | boolean | 否 | 是否忽略高度相似的。设为 true 时返回核心,排除高度相似。默认值为 false。 |
filters | array | 否 | 结果筛选条件。最多设置 8 个筛选条件,条件之间使用 and 或 or 连接。支持的运算符:regex、<、<=、>、>=、=、<>、in、not_in。 |
order_by | array | 否 | 结果排序规则。可使用与 filters 相同的字段和运算符,并使用 asc 或 desc 指定升序或降序。单次请求最多设置 3 条排序规则。 |
limit | integer | 否 | 返回结果的最大数量。默认值为 100,最大值为 1000。 |
offset | integer | 否 | 结果偏移量。默认值为 0。例如设置为 10 时,将跳过前 10 条结果。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。该值会原样返回在响应任务的 data 对象中。 |
地区和语言
location_name 与 location_code 二选一;language_name 与 language_code 二选一。
如需获取可用的地区和语言列表,可调用:
https://api.seermartech.cn/v3/dataforseo_labs/locations_and_languages
省略地区参数时,接口将尝试返回所有可用地区的数据;但本接口当前支持美国地区。
筛选条件示例
以下条件表示:自然搜索结果中排名第 1 或排名第 2-3 的数量不为 0。
json
[
"metrics.organic.pos_1",
"<>",
0
],
"or",
[
"metrics.organic.pos_2_3",
"<>",
0
]完整写法:
json
"filters": [
["metrics.organic.pos_1", "<>", 0],
"or",
["metrics.organic.pos_2_3", "<>", 0]
]请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/dataforseo_labs/bing/subdomains/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"target": "example.com",
"location_name": "United States",
"language_name": "English",
"filters": [
["metrics.organic.pos_1", "<>", 0],
"or",
["metrics.organic.pos_2_3", "<>", 0]
],
"limit": 5
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/bing/subdomains/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
payload = [
{
"target": "example.com",
"location_name": "United States",
"language_name": "English",
"filters": [
["metrics.organic.pos_1", "<>", 0],
"or",
["metrics.organic.pos_2_3", "<>", 0],
],
"limit": 5,
}
]
response = requests.post(url, headers=headers, json=payload)
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 response = await axios.post(
"https://api.seermartech.cn/v3/dataforseo_labs/bing/subdomains/live",
[
{
target: "example.com",
location_name: "United States",
language_name: "English",
filters: [
["metrics.organic.pos_1", "<>", 0],
"or",
["metrics.organic.pos_2_3", "<>", 0],
],
limit: 5,
},
],
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
console.log(response.data);响应结构
接口返回 JSON 对象 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。20000 表示成功。 |
status_message | string | 请求级状态信息。 |
time | string | 请求执行耗时,例如 0.1458 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 | 请求路径。 |
data | object | 本次请求中提交的任务参数。 |
result | array | 查询结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型,固定为 bing。 |
target | string | 请求中的目标域名。 |
location_code | integer | 请求中的地区代码。 |
language_code | string | 请求中的语言代码。 |
total_count | integer | 数据库中与请求条件的结果总数。 |
items_count | integer | 本次返回的 items 数量。 |
items | array | 子域名及排名、流量数据。 |
items 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型。 |
subdomain | string | 返回的子域名。 |
metrics | object | 该子域名的排名和流量指标。 |
metrics 中可能以下结果类型:
organic:自然搜索数据paid:付费搜索数据featured_snippet:Bing 搜索结果中的精选摘要数据local_pack:本地搜索结果数据
各结果类型的通用指标
每种结果类型对象均以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
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)与搜索量计算得出。自然搜索中表示预估月度自然流量,付费搜索及结果类型中表示对应的预估月度流量。 |
count | integer | 含该域名的对应 SERP 或结果项总数。 |
estimated_paid_traffic_cost | float | 预估流量成本。用于估算通过 Bing 搜索付费广告获取相应月度流量所需的成本,计算依据 etv 和 CPC。 |
is_new | integer | 新增排名数量。 |
is_up | integer | 排名上升的数量。 |
is_down | integer | 排名下降的数量。 |
is_lost | integer | 丢失排名的数量,即此前出现在 SERP 中、但最近一次检查未再出现的数量。 |
对于 organic,estimated_paid_traffic_cost 表示将预估自然流量转换为付费搜索流量的月度成本;对于 paid、featured_snippet 和 local_pack,该字段表示基于对应 etv 和 CPC 估算的月度搜索流量成本。
响应示例
json
{
"version": "0.1.20220216",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1458 sec.",
"cost": 0.0102,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1200 sec.",
"cost": 0.0102,
"result_count": 1,
"path": [
"v3",
"dataforseo_labs",
"bing",
"subdomains",
"live"
],
"data": {
"api": "dataforseo_labs",
"function": "subdomains",
"se_type": "bing",
"target": "example.com",
"language_name": "English",
"location_code": 2840,
"filters": [
["metrics.organic.pos_1", "<>", 0],
"or",
["metrics.organic.pos_2_3", "<>", 0]
],
"limit": 5
},
"result": [
{
"se_type": "bing",
"target": "example.com",
"location_code": 2840,
"language_code": "en",
"total_count": 1,
"items_count": 1,
"items": [
{
"se_type": "bing",
"subdomain": "blog.example.com",
"metrics": {
"organic": {
"pos_1": 12,
"pos_2_3": 18,
"pos_4_10": 45,
"pos_11_20": 31,
"pos_21_30": 20,
"pos_31_40": 15,
"pos_41_50": 10,
"pos_51_60": 8,
"pos_61_70": 6,
"pos_71_80": 4,
"pos_81_90": 3,
"pos_91_100": 2,
"etv": 12500.5,
"count": 174,
"estimated_paid_traffic_cost": 8600.2,
"is_new": 6,
"is_up": 22,
"is_down": 11,
"is_lost": 3
},
"paid": {
"pos_1": 2,
"pos_2_3": 4,
"pos_4_10": 8,
"pos_11_20": 0,
"pos_21_30": 0,
"pos_31_40": 0,
"pos_41_50": 0,
"pos_51_60": 0,
"pos_61_70": 0,
"pos_71_80": 0,
"pos_81_90": 0,
"pos_91_100": 0,
"etv": 320.4,
"count": 14,
"estimated_paid_traffic_cost": 1200.8,
"is_new": 1,
"is_up": 3,
"is_down": 1,
"is_lost": 0
}
}
}
]
}
]
}
]
}状态码与错误处理
请根据响应中的以下字段判断请求是否成功:
- 顶层
status_code - 任务级
tasks[].status_code - 对应的
status_message
状态码 20000 表示成功。状态码表示请求或任务处理异常。建议在客户端实现错误重试、参数校验、时处理和任务级错误隔离机制。
实用场景
- 识别高价值子域名:统计各子域名的自然搜索排名和预估流量,定位贡献主要 SEO 流量的、产品或地区子站。
- 发现子域名增长机会:通过
is_new、is_up和排名区间数据,筛选近期增长较快的子域名,优和外链资源。 - 定位排名流失风险:使用
historical_serp_mode=lost和is_lost识别排名消失的子域名,支持技术排查和恢复。 - 评估自然流量的广告价值:结合
etv与estimated_paid_traffic_cost,估算各子域名自然流量对应的 Bing 付费获取成本。 - 对比搜索结果类型表现:分别查询
organic、paid、featured_snippet和local_pack,分析子域名在不同 Bing 搜索结果类型中的结构。