主题
获取 Bing 历史搜索量结果(按任务 ID)
本接口用于根据任务 ID 获取 Bing 历史搜索量结果。单次任务最多可 1000 个,支持按 月度、周度、日度 返回历史搜索量,并可区分设备类型。
调用方式:
GET /v3/keywords_data/bing/search_volume_history/task_get/{id}
完整请求地址示例:
https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/task_get/{id}
计费说明
该接口本身不会重复收费,在创建任务时扣费;任务结果在后续 30 天 可反复获取。
如平台单次任务有计费,请按以下方式理解参考价:
参考价约以任务提交接口报价为准,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
接口说明
通过任务提交接口创建任务后,系统会返回唯一的任务 ID。你可以在任务完成后,使用该 ID 在 30 天随时获取结果。
路径参数
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。可在任务创建后的 30 天用于获取结果。 |
返回结构
接口返回 JSON 对象,顶层 tasks 数组,数组中为本次请求对应的任务结果。
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 接口级状态码。完整错误码参考 /v3/appendix/errors。建议在接时做好异常处理。 |
status_message | string | 接口级状态信息。 |
time | string | 请求执行耗时,单位秒。 |
cost | float | 本次请求总成本,单位 USD。获取结果通常为 0。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | 返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID,UUID 格式。 |
status_code | integer | 任务级状态码,范围通常为 10000-60000。完整错误码参考 /v3/appendix/errors。 |
status_message | string | 任务级状态信息。 |
time | string | 任务执行耗时,单位秒。 |
cost | float | 该任务成本,单位 USD。 |
result_count | integer | result 数组中的结果数。 |
path | array | 当前请求对应的 URL 路径。 |
data | object | 任务提交时传的原始参数。 |
result | array | 实结果数组。 |
result 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
keyword | string | POST 创建任务时传的。 |
location_code | integer | POST 创建任务时传的位置编码;若无数据则为 null。 |
language_code | string | POST 创建任务时传的语言编码;若无数据则为 null。 |
device | string | POST 创建任务时传的设备类型;若无数据则为 null。 |
period | string | 时间粒度,表示返回数据的聚合周期。默认值为 monthly。 |
searches | object | 按设备类型拆分的历史搜索量数据;如果未指定 device,则返回所有可用设备的数据。 |
searches 字段说明
desktop
桌面设备搜索量历史数据。
| 字段名 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
day | integer | 当月第几天 |
search_volume | integer | 搜索量 |
non_smartphones
功能机 / 非智能手机设备搜索量历史数据。
| 字段名 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
day | integer | 当月第几天 |
search_volume | integer | 搜索量 |
mobile
移动设备搜索量历史数据。
| 字段名 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
day | integer | 当月第几天 |
search_volume | integer | 搜索量 |
tablet
平板设备搜索量历史数据。
| 字段名 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
day | integer | 当月第几天 |
search_volume | integer | 搜索量 |
使用建议
通常推荐按以下流程调用:
- 通过对应的任务提交接口创建历史搜索量任务;
- 再通过
/v3/keywords_data/bing/search_volume_history/tasks_ready查询已完成任务; - 最后使用本接口
/v3/keywords_data/bing/search_volume_history/task_get/{id}按任务 ID 获取结果。
请求示例
cURL
bash
id="10081455-0001-0110-0000-c75b21dcca1c"
curl --location --request GET "https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/task_get/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02231934-2604-0066-2000-570459f04879"
url = f"https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/task_get/{task_id}"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json)TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios({
method: "get",
url: `https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/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);
});查询已完成任务后再获取结果示例
Python
python
import requests
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
# 1. 获取已完成任务列表
ready_url = "https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/tasks_ready"
ready_resp = requests.get(ready_url, headers=headers).json
results = []
if ready_resp.get("status_code") == 20000:
for task in ready_resp.get("tasks", []):
for item in task.get("result", []) or []:
endpoint = item.get("endpoint")
if endpoint:
# 2. 按 endpoint 获取单个任务结果
task_resp = requests.get(
"https://api.seermartech.cn" + endpoint,
headers=headers
).json
results.append(task_resp)
print(results)TypeScript
typescript
import axios from "axios";
const headers = {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
};
async function fetchCompletedTasks {
const readyResponse = await axios.get(
"https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/tasks_ready",
{ headers }
);
const results: any[] = [];
if (readyResponse.data.status_code === 20000) {
for (const task of readyResponse.data.tasks || []) {
for (const item of task.result || []) {
if (item.endpoint) {
const taskResponse = await axios.get(
`https://api.seermartech.cn${item.endpoint}`,
{ headers }
);
results.push(taskResponse.data);
}
}
}
}
console.log(results);
}
fetchCompletedTasks.catch(console.error);响应示例
json
{
"version": "0.1.20240626",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "keywords_data",
"function": "search_volume_history",
"se": "bing",
"id": "07101317-1535-0260-0000-5f5e20c3d82e",
"location_code": 2840,
"language_code": "en",
"keywords": []
},
"result": [
{
"period": "monthly",
"searches": {
"desktop": [],
"non_smartphones": [],
"mobile": [],
"tablet": []
}
}
]
}
]
}状态码与异常处理
请同时检查两个层级的状态:
- 顶层
status_code:表示整次 API 请求是否成功; tasks[].status_code:表示任务是否成功返回结果。
建议处理逻辑:
20000:请求成功;40000及以上:通常表示任务级错误或请求异常;result为空:任务可能尚未完成、无数据,或参数不匹。
完整错误码与说明可参考 /v3/appendix/errors。
注意事项
- 任务结果可在创建后的 30 天 获取;
- 单个任务最多支持 1000 个;
- 若未指定
device,返回结果会所有可用设备类型; period可对应月、周、日等时间粒度,取决于任务提交时的参数;- 当某些维度无数据时,
location_code、language_code、device可能返回null。
实用场景
- 分析季节性波动:按月或按周查看历史搜索量变化,识别淡旺季,为排期和投放节奏提供依据。
- 对比不同设备搜索趋势:拆分 desktop、mobile、tablet 等设备流量,判断移动端优还是桌面端优,优化页面体验与资源。
- 监控核心词热度变化:定期拉取品牌词、品类词的历史趋势,及时发现需求上涨或下滑,运营预警。
- 评估区域与语言市场机会:结合
location_code和language_code查看不同市场中的表现,支持出海 SEO 和多语言策略。 - 构建趋势数据库:批量获取历史搜索量并沉淀到数据仓库,用于预测模型、选题系统或 SEO 看板分析。