主题
Bing 历史搜索量(实时)
接口说明
该接口用于实时获取 Bing 的历史搜索量数据,单次请求最多可提交 1000 个。
支持按以下时间粒度返回数据:
- 月度:最多近 24 个月
- 周度:最多近 15 周
- 日度:最多近 45 天
同时支持按设备类型筛选:
mobiledesktoptabletnon_smartphones
如果你的业务需要即时返回结果,建议使用本接口的 实时(Live)模式。与标准任务模式不同,Live 模式无需 POST 创建任务再 GET 获取结果,提交后即可直接获得结果。
如果你不要求实时结果,也可以使用标准模式 /v3/keywords_data/bing/search_volume/task_post/:成本更低,但需要分两步获取数据。
历史数据最长可追溯 24 个月。
请求地址
POST https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/live
计费与限流
- 本接口按请求计费,而不是按数量计费
- 一次请求无论提交 1 个还是 1000 个,均按 1 次请求收费
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准 - 接口频率上限:2000 次 API 调用/分钟
请求体格式
所有 POST 数据均需使用 UTF-8 编码的 JSON 格式提交。
请求体为 JSON 数组:
json
[
{
"location_name": "United States",
"language_name": "English",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
]
}
]请求参数
| 字段名 | 类型 | 说明 |
|---|---|---|
keywords | array | 填。数组。最多可传 1000 个;每个最长 100 个字符。系统会自动将转换为小写。结果会按每个分别返回。 |
location_name | string | 搜索引擎地域完整名称。若未传 location_code 或 location_coordinate,则此字段填。传该字段后,无需再传 location_code 或 location_coordinate。示例:London,England,United Kingdom |
location_code | integer | 搜索引擎地域代码。若未传 location_name 或 location_coordinate,则此字段填。传该字段后,无需再传 location_name 或 location_coordinate。示例:2840 |
location_coordinate | string | 地理坐标,格式为 "latitude,longitude"。若未传 location_name 或 location_code,则此字段填。传该字段后,无需再传 location_name 或 location_code。返回的是该坐标所属国家的数据。示例:52.6178549,-155.352142 |
language_name | string | 搜索引擎语言完整名称。若未传 language_code,则此字段填。传后无需再传 language_code。 |
language_code | string | 搜索引擎语言代码。若未传 language_name,则此字段填。传后无需再传 language_name。 |
device | array | 可选。指定设备类型返回对应设备的数据。可选值:mobile、desktop、tablet、non_smartphones。默认不传时,返回所有可用设备的数据。 |
period | string | 可选。指定时间聚合粒度。可选值:monthly、weekly、daily。默认值:monthly。monthly 最多返回近 24 个月;weekly 最多返回近 15 周;daily 最多返回近 45 天。 |
date_from | string | 可选。开始日期,格式:"yyyy-mm-dd"。最早可传今天往前 24 个月,最晚可传到明天前 1 天。示例:"2020-01-01"。不建议使用自定义时间范围。 |
date_to | string | 可选。结束日期,格式:"yyyy-mm-dd"。最早可传今天往前 2 年,最晚可传到明天前 1 天。示例:"2020-03-15"。不建议使用自定义时间范围。 |
tag | string | 可选。用户自定义任务标识,最大长度 255。可用于业务侧请求与结果。响应中会在 data 对象原样返回该值。 |
地域与语言列表获取
可通过以下接口获取可用的地域与语言列表:
/v3/keywords_data/bing/search_volume_history/locations_and_languages
时间范围说明
如果未传 date_from 和 date_to:
- 默认返回近 24 个月数据
- 当
period=weekly时,返回近 15 周 - 当
period=daily时,返回近 45 天
响应结构
接口返回 JSON 编码数据,顶层 tasks 数组。
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码 |
status_message | string | 通用状态信息 |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总费用 |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | 返回错误的任务数量 |
tasks | array | 任务结果数组 |
tasks[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,通常范围 10000-60000 |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时,单位秒 |
cost | float | 当前任务费用 |
result_count | integer | result 数组中的数量 |
path | array | 请求路径 |
data | object | 与请求中提交参数一致的数据对象 |
result | array | 结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
keyword | string | 请求中的 |
location_code | integer | 请求中的地域代码;若无数据则为 null |
language_code | string | 请求中的语言代码;若无数据则为 null |
device | string | 请求中的设备类型;若未指定或无数据则可能为 null |
period | string | 返回数据的时间粒度,默认 monthly |
searches | object | 按设备类型分组的历史搜索量数据;若请求未指定 device,则返回所有可用设备类型 |
searches 下的设备字段
searches 中可能以下字段:
desktopnon_smartphonesmobiletablet
每个设备字段对应一组历史搜索量数据,字段如下:
| 字段名 | 类型 | 说明 |
|---|---|---|
year | integer | 年 |
month | integer | 月 |
day | integer | 日 |
search_volume | integer | 搜索量 |
说明:当
period=monthly时,通常主要使用year、month;当period=daily时,day字段更有意义。
状态码与错误处理
- 顶层
status_code表示本次请求整体状态 tasks[].status_code表示单个任务状态- 建议在接时同时处理 HTTP 错误、业务状态码错误以及空结果场景
常见成功状态:
20000:成功
完整错误码体系可参考 /v3/appendix/errors。
请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"location_name": "United States",
"language_name": "English",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
"period": "monthly"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
payload = [
{
"location_name": "United States",
"language_name": "English",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
"period": "monthly"
}
]
response = requests.post(url, headers=headers, json=payload)
data = response.json
if data.get("status_code") == 20000:
print(data)
else:
print(f"请求失败: {data.get('status_code')} - {data.get('status_message')}")TypeScript
typescript
const response = await fetch("https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/live", {
method: "POST",
headers: {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify([
{
location_name: "United States",
language_name: "English",
keywords: [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
period: "monthly"
}
])
});
const data = await response.json;
if (data.status_code === 20000) {
console.log(data);
} else {
console.error(`请求失败: ${data.status_code} - ${data.status_message}`);
}响应示例
json
{
"version": "0.1.20240626",
"status_code": 20000,
"status_message": "Ok.",
"time": "12.9494 sec.",
"cost": 0.075,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status_code": 20000,
"status_message": "Ok.",
"time": "12.9494 sec.",
"cost": 0.075,
"result_count": 3,
"path": [
"v3",
"keywords_data",
"bing",
"search_volume_history",
"live"
],
"data": {
"api": "keywords_data",
"function": "search_volume_history",
"se": "bing",
"location_code": 2840,
"language_code": "en",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
]
},
"result": [
{
"keyword": "average page rpm adsense",
"location_code": 2840,
"language_code": "en",
"device": null,
"period": "monthly",
"searches": {
"desktop": [
{
"year": 2024,
"month": 5,
"day": null,
"search_volume": 120
}
],
"non_smartphones": [],
"mobile": [
{
"year": 2024,
"month": 5,
"day": null,
"search_volume": 210
}
],
"tablet": []
}
}
]
}
]
}返回结果解读
- 每个都会单独出现在
result数组中 searches会按设备类型拆分历史数据- 如果请求未指定
device,通常会返回多个设备维度 - 某些设备类型可能为空数组,表示该维度下暂无可用数据
- 若某没有可用历史数据,对应字段可能为
null或空数组
使用建议
- 批量查询优合并请求:由于按请求计费,建议将多个合并到一次请求中,利用单次最多 1000 个的能力。
- 实时场景优 Live:适用于报表页面、实时分析、即时评估等场景。
- 非实时任务可用标准模式:如果延迟获取结果,可改用标准任务接口以降低成本。
- 谨使用自定义日期区间:平台明确不建议自定义时间范围,建议优使用系统默认周期返回逻辑。
- 按设备分析趋势:如需识别移动端与桌面端需求差异,建议指定或拆分
device参数进行分析。
实用场景
- 评估季节性:查看某批近 24 个月的月度搜索量变化,用于判断是否存在淡旺季,发布时间规划。
- 识别设备端流量差异:对比
mobile与desktop的历史搜索量,帮助制定移动优还是桌面优的 SEO 与投放策略。 - 验证热点是否短期爆发:通过
daily或weekly粒度观察最近趋势,快速判断某个话题是否正在升温。 - 筛选值得布局的:批量提交候选词并比较历史搜索量稳定性,优选择长期有需求、波动可控的。
- 支撑化选题:结合不同地域和语言参数,分析同一主题在不同国家/语言市场的搜索热度变化,为多地区运营提供依据。