主题
Bing (实时)
本接口使用 POST 方法,路径为 /v3/dataforseo_labs/bing/related_keywords/live。接口用于获取 Bing 搜索结果页“搜索”区域中的,并返回近 12 个月的搜索量趋势、最近一个月平均搜索量、每次点击费用(CPC)、竞争度及 SERP 数据。
接口说明
- 数据源:本平台 SERP 数据库
- 搜索算法:针对指定种子,对 SERP“搜索”中的查询词执行深度优搜索
- 返回规模:通过
depth参数最多可获取约 4,680 个建议 - 支持地区:当前支持美国(United States,代码
2840) - 请求格式:JSON,UTF-8 编码
- 批量限制:单次请求可提交多个任务,最多 2,000 次 API 调用/分钟
- 并发限制:同时处理的请求数最多为 30 个
例如,种子为 keyword research 且 depth=1 时,可能返回以下:
free keyword researchkeyword research toolsbest free keyword research toolkeyword research tipsseo keyword research toolkeyword research step by stephow to do keyword researchkeyword research google ads
计费说明
每个任务请求都会产生费用。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求体是 JSON 数组,数组中的每个对象代表一个任务。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | 种子。使用 UTF-8 编码,系统会将转换为小写格式。 |
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。 |
depth | integer | 否 | 搜索深度,取值范围为 0 至 4,默认值为 1。返回规模取决于该参数。 |
include_seed_keyword | boolean | 否 | 是否返回种子本身的数据。设为 true 后,数据将出现在响应的 seed_keyword_data 数组中。默认值为 false。 |
include_serp_info | boolean | 否 | 是否返回每个的 SERP 数据搜索结果数量、 URL 和 SERP 特征。默认值为 false。 |
replace_with_core_keyword | boolean | 否 | 是否使用组中的核心返回数据。设为 true 时,serp_info 和 related_keywords 将针对该所属组的核心返回;设为 false 时,针对请求中的返回(如果可用)。默认值为 false。 |
ignore_synonyms | boolean | 否 | 是否忽略高度相似的。设为 true 时返回核心,并排除高度相似的。默认值为 false。 |
filters | array | 否 | 结果过滤条件。最多可同时设置 8 个过滤条件,多个条件之间需要使用 and 或 or。 |
order_by | array | 否 | 结果排序规则。最多设置 3 条排序规则,可使用与 filters 相同的字段和表达式。 |
limit | integer | 否 | 最多返回的数量。默认值为 100,最大值为 1000。 |
offset | integer | 否 | 结果偏移量。默认值为 0。例如设置为 10 时,将跳过结果数组中的前 10 个。 |
tag | string | 否 | 自定义任务标识,最多 255 个字符。该值会原样返回在响应的 data 对象中,可用于匹请求和结果。 |
depth 返回规模
| 深度 | 预计最多返回的数 |
|---|---|
0 | 请求中的种子 |
1 | 8 |
2 | 72 |
3 | 584 |
4 | 4,680 |
filters 支持的运算符
支持以下运算符:
text
regex
not_regex
<
<=
>
>=
=
<>
in
not_in
ilike
not_ilike
like
not_like
match
not_matchlike、not_like、ilike 和 not_ilike 支持使用 % 匹零个或多个字符。
示例:
json
[
{
"keyword": "phone",
"location_code": 2840,
"language_code": "en",
"filters": [
[
"keyword_data.keyword_info.search_volume",
">",
10
]
],
"limit": 3
}
]过滤字段通常使用结果对象中的完整路径,例如:
text
keyword_data.keyword_info.search_volume
keyword_data.keyword_info.competition
keyword_data.keyword_info.cpc
keyword_data.keywordorder_by 格式
排序规则格式如下:
json
[
"keyword_data.keyword_info.search_volume,desc"
]多个排序规则使用逗号分隔,并且单次请求最多设置 3 条规则:
json
[
"keyword_data.keyword_info.search_volume,desc",
"keyword_data.keyword_info.competition,asc"
]排序类型:
asc:升序desc:降序
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/dataforseo_labs/bing/related_keywords/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "phone",
"location_name": "United States",
"language_name": "English",
"depth": 1,
"include_serp_info": false,
"filters": [
[
"keyword_data.keyword_info.search_volume",
">",
10
]
],
"limit": 3
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/bing/related_keywords/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
payload = [
{
"keyword": "phone",
"location_name": "United States",
"language_name": "English",
"filters": [
[
"keyword_data.keyword_info.search_volume",
">",
10,
]
],
"limit": 3,
}
]
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,错误码:{},错误信息:{}".format(
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/related_keywords/live",
[
{
keyword: "phone",
location_name: "United States",
language_name: "English",
filters: [
["keyword_data.keyword_info.search_volume", ">", 10],
],
limit: 3,
},
],
{
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 | 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 | 请求 API 的路径信息。 |
data | object | 请求中提交的任务参数。 |
result | array | 结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型,固定为 bing。 |
seed_keyword | string | 请求中的种子。 |
seed_keyword_data | array | 种子数据。在 include_seed_keyword=true 时返回,字段结构与 keyword_data 相同。 |
location_code | integer | 地区代码。 |
language_code | string | 语言代码。 |
total_count | integer | 数据库中与请求条件的结果总数。 |
items_count | integer | items 数组中的返回数量。 |
items | array | 及指标数据。 |
items 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型。 |
keyword_data | object | 当前的数据。 |
serp_info | object/null | 当前的 SERP 数据。未设置 include_serp_info=true 或数据库中没有对应 SERP 数据时为 null。 |
depth | integer | 当前在搜索树中的深度。 |
related_keywords | array | 与当前的搜索查询列表。 |
keyword_data 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型。 |
keyword | string | 当前返回的。 |
location_code | integer | 地区代码。 |
language_code | string | 语言代码。 |
keyword_info | object | 搜索量、竞争度和 CPC 等指标。 |
keyword_properties | object | 附加属性。 |
serp_info | object/null | 当前的 SERP 数据。 |
keyword_info 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型。 |
last_updated_time | string | 数据更新时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
competition | float | 竞争度,基于 Bing Ads 数据,取值范围为 0 至 1。 |
cpc | float/null | 历史平均每次点击费用。 |
search_volume | integer | 平均月搜索量,表示该在 Bing 上的预估月均搜索次数。 |
monthly_searches | array | 过去 12 个月的月度搜索量数据。 |
monthly_searches 数组中的字段:
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
search_volume | integer | 当月预估搜索量。 |
keyword_properties 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型。 |
core_keyword | string/null | 组中的核心。该值由同义词聚类算法确定;如果为 null,表示系统未识别出对应的同义词。 |
synonym_clustering_algorithm | string/null | 同义词识别算法。keyword_metrics 表示基于指标的算法;text_processing 表示基于文本处理的算法。 |
keyword_difficulty | integer | 排名难度,按 0 至 100 的对数刻度表示自然搜索结果前 10 名的难度。 |
detected_language | string | 系统识别出的语言。 |
is_another_language | boolean | 检测出的语言是否与请求中设置的语言不同。true 表示不一致。 |
serp_info 字段
当 include_serp_info 未设置为 true,或数据库中没有该的 SERP 数据时,serp_info 为 null。
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型。 |
check_url | string | 指向搜索引擎结果页的直接 URL,可用于核验结果准确性。 |
serp_item_types | array | SERP 中出现的结果类型。 |
se_results_count | integer | 当前对应的搜索结果数量。 |
last_updated_time | string | SERP 数据更新时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
serp_item_types 可能:
text
answer_box
carousel
events
featured_snippet
hotels_pack
images
jobs
local_pack
map
organic
paid
people_also_ask
people_also_search
questions_and_answers
recipes
related_searches
shopping
top_stories
video
ai_overview只有以下结果类型会返回结果项:
organicpaidfeatured_snippetlocal_pack
响应示例
json
{
"version": "0.1.20220216",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0730 sec.",
"cost": 0.0105,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0600 sec.",
"cost": 0.0105,
"result_count": 1,
"path": [
"v3",
"dataforseo_labs",
"bing",
"related_keywords",
"live"
],
"data": {
"api": "dataforseo_labs",
"function": "related_keywords",
"se_type": "bing",
"keyword": "windows",
"language_name": "English",
"location_code": 2840,
"limit": 5
},
"result": [
{
"se_type": "bing",
"seed_keyword": "windows",
"location_code": 2840,
"language_code": "en",
"total_count": 5,
"items_count": 5,
"items": [
{
"se_type": "bing",
"keyword_data": {
"se_type": "bing",
"keyword": "windows replacement",
"location_code": 2840,
"language_code": "en",
"keyword_info": {
"se_type": "bing",
"last_updated_time": "2022-03-14 11:42:07 +00:00",
"competition": 0.9,
"cpc": 5.79,
"search_volume": 470,
"monthly_searches": [
{
"year": 2022,
"month": 3,
"search_volume": 470
}
]
},
"keyword_properties": {
"se_type": "bing",
"core_keyword": "replacement windows",
"synonym_clustering_algorithm": "text_processing",
"keyword_difficulty": 100,
"detected_language": "en",
"is_another_language": false
}
},
"serp_info": null
}
]
}
]
}
]
}状态码与错误处理
请根据顶层 status_code、任务级 status_code 和对应的 status_message 判断请求是否成功。建议在业务系统中同时处理以下:
- HTTP 请求失败;
- 顶层任务提交失败;
- 单个任务执行失败;
tasks_error大于0;result为空或serp_info为null。
完整状态码列表请参考错误码文档。
实用场景
- 扩展种子:从核心词递归获取 Bing 搜索词,扩大 SEO和落地页的覆盖范围。
- 筛选高潜力词:结合
search_volume、competition和cpc过滤结果,优识别搜索需求高且商业价值明确的。 - 构建集群:利用
core_keyword和同义词聚类信息合并相似词,减少页面之间的竞争。 - 规划主题:
depth获取不同层级的查询,组织主题集群、支柱页和长尾结构。 - 监测 SERP 机会:启用
include_serp_info分析对应的 SERP 特征,定位自然结果、精选摘要、本地结果等可争取的排名机会。