主题
按任务 ID 获取拓展结果(Bing)
本接口使用 GET 方法,通过任务 ID 获取 Bing 拓展结果。
请求路径:
text
GET https://api.seermartech.cn/v3/keywords_data/bing/keywords_for_keywords/task_get/$id该接口会返回与指定的建议。创建任务时最多可提交 200 个,每个任务最多可获取 3,000 条建议。
计费说明
- 账户在提交拓展任务时产生费用。
- 任务结果自创建之日起 30 天可重复获取,获取结果不额外收费。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
id 为路径参数,无需提交 JSON 请求体。
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。任务创建后 30 天可使用该 ID 随时获取结果。 |
返回结果
接口返回 JSON 对象 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求的通用状态码。完整状态码请参考错误码文档。 |
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 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的。 |
location_code | integer | 地理位置代码。 |
language_code | string | 语言代码。 |
search_partners | boolean | 是否合作伙伴网络的数据。 |
device | string | 数据对应的设备类型。可选值:all、mobile、desktop、tablet。 |
competition | float | 付费搜索结果中的相对竞争程度,数据基于 Bing Ads。可选值:0.1、0.5、0.9,分别表示低、中、高竞争度;无数据时返回 null。 |
cpc | float | 该历史平均每次点击费用。无数据时返回 null。 |
search_volume | integer | 在 Bing 上的月均搜索量,目标地域和定位条件估算,并进行取整。无数据时返回 null。 |
categories | array | 产品和服务类别。该字段为历史容字段,当前始终返回 null。 |
monthly_searches | array | 过去 12 个月的月度搜索量,指定地理位置统计;无数据时返回 null。 |
monthly_searches[].year | integer | 年份。 |
monthly_searches[].month | integer | 月份。 |
monthly_searches[].search_volume | integer | 对应月份的搜索量,按近似值取整。 |
请求示例
curl
bash
id="10251444-0001-0107-0000-7fc657a2f62c"
curl --location --request GET \
"https://api.seermartech.cn/v3/keywords_data/bing/keywords_for_keywords/task_get/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios
.get(
`https://api.seermartech.cn/v3/keywords_data/bing/keywords_for_keywords/task_get/${taskId}`,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.then((response) => {
// 处理拓展结果
console.log(response.data);
})
.catch((error) => {
// 处理请求错误
console.error(error.response?.data || error.message);
});Python
python
import requests
task_id = "10251444-0001-0107-0000-7fc657a2f62c"
url = (
"https://api.seermartech.cn/v3/keywords_data/bing/"
f"keywords_for_keywords/task_get/{task_id}"
)
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
if data.get("status_code") == 20000:
# 读取任务结果
for task in data.get("tasks", []):
if task.get("status_code", 0) >= 40000:
print(
f"任务失败:{task.get('status_code')} "
f"{task.get('status_message')}"
)
else:
print(task.get("result", []))
else:
print(
f"请求失败:{data.get('status_code')} "
f"{data.get('status_message')}"
)返回示例
json
{
"version": "0.1.20200923",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "10251444-0001-0107-0000-7fc657a2f62c",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"result_count": 2,
"path": [
"v3",
"keywords_data",
"bing",
"keywords_for_keywords",
"task_get",
"10251444-0001-0107-0000-7fc657a2f62c"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_keywords",
"se": "bing",
"location_code": 2840,
"language_code": "en",
"keywords": [
"coupon"
]
},
"result": [
{
"keyword": "coupon",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"device": "all",
"competition": 0.9,
"cpc": 0.51,
"search_volume": 14640,
"categories": null,
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 14640
}
]
},
{
"keyword": "advertise my business",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"device": "all",
"competition": 0.9,
"cpc": 1.5,
"search_volume": 8980,
"categories": null,
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 8980
}
]
}
]
}
]
}状态码与异常处理
建议客户端同时检查以下字段:
- 顶层
status_code:判断本次 API 请求是否成功。 tasks[].status_code:判断任务是否成功。status_message和tasks[].status_message:获取错误或状态说明。tasks_error:统计返回错误的任务数量。
当任务状态码表示失败,或 result 为空时,应记录任务 ID 和状态信息,并根据业务需要重试或标记任务失败。
实用场景
- 扩展种子:获取与核心词的 Bing 建议,扩大 SEO和落地页的覆盖范围。
- 筛选高潜:结合
search_volume、competition和cpc指标,优选择搜索需求较高且竞争度合适的。 - 制定区域化 SEO 策略:按
location_code和language_code对结果进行地域与语言拆分,支持多市场规划。 - 分析设备搜索差异:利用
device字段比较桌面端、移动端和平板端的数据,优化不同设备的页面策略。 - 跟踪季节性:读取
monthly_searches的 12 个月数据,识别搜索趋势和季节性需求,安排发布与推广周期。