主题
批量获取 Bing 难度
本接口使用 POST 方法,路径为:
/v3/dataforseo_labs/bing/bulk_keyword_difficulty/live
一次请求最多提交 1,000 个,并返回每个的 Keyword Difficulty(难度)指标。
难度用于衡量某个 Bing 前 10 条自然搜索结果的相对难度,取值范围为 0–100,采用对数刻度表示。数值越高,自然搜索结果前 10 名的难度越大。该指标综合分析搜索结果页前 10 个页面的链接等因素计算得出。
请求说明
- 请求方法:
POST - 请求地址:
https://api.seermartech.cn/v3/dataforseo_labs/bing/bulk_keyword_difficulty/live - 请求格式:JSON,UTF-8 编码
- 请求体格式:JSON 数组,即
[{ ... }] - 单次请求最多提交:1,000 个
- 速率限制:每分钟最多 2,000 次 API 调用
- 并发限制:最多同时发送 30 个请求
- 认证方式:Bearer Token
计费
每次请求按接口调用计费。原始接口未提供固定单价,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求体中的每个对象代表一个任务。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keywords | array | 是 | 目标列表。最多可提交 1,000 个。会被转换为小写格式。 |
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 |
tag | string | 否 | 自定义任务标识,用于识别任务并匹结果。最大长度为 255 个字符。提交的值会原样返回在响应的 data 对象中。 |
location_name 与 location_code 至少填写一个;language_name 与 language_code 至少填写一个。
可通过以下接口获取可用的地区和语言列表:
https://api.seermartech.cn/v3/dataforseo_labs/locations_and_languages
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/dataforseo_labs/bing/bulk_keyword_difficulty/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keywords": [
"dentist new york",
"pizza brooklyn",
"car dealer los angeles"
],
"location_code": 2840,
"language_code": "en",
"tag": "bing-kd-demo"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/bing/bulk_keyword_difficulty/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
payload = [
{
"keywords": [
"dentist new york",
"pizza brooklyn",
"car dealer los angeles",
],
"location_name": "United States",
"language_name": "English",
}
]
response = requests.post(url, headers=headers, json=payload, timeout=60)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
f"请求失败,错误码:{result.get('status_code')},"
f"错误信息:{result.get('status_message')}"
)TypeScript
typescript
import axios from "axios";
const response = await axios.post(
"https://api.seermartech.cn/v3/dataforseo_labs/bing/bulk_keyword_difficulty/live",
[
{
keywords: [
"dentist new york",
"pizza brooklyn",
"car dealer los angeles",
],
location_code: 2840,
language_code: "en",
tag: "bing-kd-demo",
},
],
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
const result = response.data;
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(
`请求失败,错误码:${result.status_code},错误信息:${result.status_message}`
);
}响应结构
接口返回 JSON 数据,顶层 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用状态码。成功通常为 20000。 |
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 | 请求路径信息。 |
data | object | 请求中提交的任务参数。 |
result | array | 难度结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型,本接口为 bing。 |
location_code | integer | 请求中使用的地区代码。无数据时为 null。 |
language_code | string | 请求中使用的语言代码。无数据时为 null。 |
total_count | integer | 数据库中与请求的结果总数。 |
items_count | integer | items 数组中返回的结果数量。 |
items | array | 含及难度的结果数组。 |
items 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型,本接口为 bing。 |
keyword | string | 请求中提交的。 |
keyword_difficulty | integer | 难度,取值范围为 0–100。该值用于表示 Bing 自然搜索结果前 10 名的难度,数值越高表示竞争越激烈。 |
响应示例
json
{
"version": "0.1.20220216",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0760 sec.",
"cost": 0.0103,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0500 sec.",
"cost": 0.0103,
"result_count": 1,
"path": [
"v3",
"dataforseo_labs",
"bing",
"bulk_keyword_difficulty",
"live"
],
"data": {
"api": "dataforseo_labs",
"function": "bulk_keyword_difficulty",
"se_type": "bing",
"keywords": [
"dentist new york",
"pizza brooklyn",
"car dealer los angeles"
],
"location_code": 2840,
"language_code": "en",
"tag": "bing-kd-demo"
},
"result": [
{
"se_type": "bing",
"location_code": 2840,
"language_code": "en",
"total_count": 3,
"items_count": 3,
"items": [
{
"se_type": "bing",
"keyword": "dentist new york",
"keyword_difficulty": 72
},
{
"se_type": "bing",
"keyword": "pizza brooklyn",
"keyword_difficulty": 58
},
{
"se_type": "bing",
"keyword": "car dealer los angeles",
"keyword_difficulty": 64
}
]
}
]
}
]
}状态码与错误处理
请根据顶层 status_code、任务级 status_code 及对应的 status_message 判断请求和任务是否成功。建议在客户端实现以下处理逻辑:
- 检查 HTTP 响应是否成功。
- 再检查顶层
status_code是否为20000。 - 检查
tasks_error是否大于0。 - 对每个任务单独检查
status_code。 - 记录
id、tag和错误信息,便于重试与问题追踪。
完整错误码请参考:/v3/appendix/errors
实用场景
- 批量筛选低难度:一次提交大量候选词并获取难度分数,优确定更容易获得 Bing 自然流量的目标词。
- 评估选题竞争度:在规划前比较多个主题的难度,合理安排高竞争词与长尾词的发布节奏。
- 制定区域 SEO 方案:针对美国市场批量分析本地服务类,为城市页、门店页和区域落地页选择合适的优化词。
- 比较竞争梯度:将同一业务下的多个按难度分层,为不同权重页面分匹的目标。
- 构建研究报表:结合
tag标记不同项目或批次,将难度结果回写到 SEO 数据仓库,支持后续选词和排名分析。