Skip to content

Bing 历史搜索量(实时)

接口说明

该接口用于实时获取 Bing 的历史搜索量数据,单次请求最多可提交 1000 个。

支持按以下时间粒度返回数据:

  • 月度:最多近 24 个月
  • 周度:最多近 15 周
  • 日度:最多近 45 天

同时支持按设备类型筛选:

  • mobile
  • desktop
  • tablet
  • non_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"
 ]
 }
]

请求参数

字段名类型说明
keywordsarray。数组。最多可传 1000 个;每个最长 100 个字符。系统会自动将转换为小写。结果会按每个分别返回。
location_namestring搜索引擎地域完整名称。若未传 location_codelocation_coordinate,则此字段填。传该字段后,无需再传 location_codelocation_coordinate。示例:London,England,United Kingdom
location_codeinteger搜索引擎地域代码。若未传 location_namelocation_coordinate,则此字段填。传该字段后,无需再传 location_namelocation_coordinate。示例:2840
location_coordinatestring地理坐标,格式为 "latitude,longitude"。若未传 location_namelocation_code,则此字段填。传该字段后,无需再传 location_namelocation_code返回的是该坐标所属国家的数据。示例:52.6178549,-155.352142
language_namestring搜索引擎语言完整名称。若未传 language_code,则此字段填。传后无需再传 language_code
language_codestring搜索引擎语言代码。若未传 language_name,则此字段填。传后无需再传 language_name
devicearray可选。指定设备类型返回对应设备的数据。可选值:mobiledesktoptabletnon_smartphones。默认不传时,返回所有可用设备的数据。
periodstring可选。指定时间聚合粒度。可选值:monthlyweeklydaily。默认值:monthlymonthly 最多返回近 24 个月;weekly 最多返回近 15 周;daily 最多返回近 45 天。
date_fromstring可选。开始日期,格式:"yyyy-mm-dd"。最早可传今天往前 24 个月,最晚可传到明天前 1 天。示例:"2020-01-01"不建议使用自定义时间范围
date_tostring可选。结束日期,格式:"yyyy-mm-dd"。最早可传今天往前 2 年,最晚可传到明天前 1 天。示例:"2020-03-15"不建议使用自定义时间范围
tagstring可选。用户自定义任务标识,最大长度 255。可用于业务侧请求与结果。响应中会在 data 对象原样返回该值。

地域与语言列表获取

可通过以下接口获取可用的地域与语言列表:

/v3/keywords_data/bing/search_volume_history/locations_and_languages

时间范围说明

如果未传 date_fromdate_to

  • 默认返回近 24 个月数据
  • period=weekly 时,返回近 15 周
  • period=daily 时,返回近 45 天

响应结构

接口返回 JSON 编码数据,顶层 tasks 数组。

顶层字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码
status_messagestring通用状态信息
timestring执行耗时,单位秒
costfloat本次请求总费用
tasks_countintegertasks 数组中的任务数量
tasks_errorinteger返回错误的任务数量
tasksarray任务结果数组

tasks[] 字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,通常范围 10000-60000
status_messagestring任务状态说明
timestring任务执行耗时,单位秒
costfloat当前任务费用
result_countintegerresult 数组中的数量
patharray请求路径
dataobject与请求中提交参数一致的数据对象
resultarray结果数组

result[] 字段

字段名类型说明
keywordstring请求中的
location_codeinteger请求中的地域代码;若无数据则为 null
language_codestring请求中的语言代码;若无数据则为 null
devicestring请求中的设备类型;若未指定或无数据则可能为 null
periodstring返回数据的时间粒度,默认 monthly
searchesobject按设备类型分组的历史搜索量数据;若请求未指定 device,则返回所有可用设备类型

searches 下的设备字段

searches 中可能以下字段:

  • desktop
  • non_smartphones
  • mobile
  • tablet

每个设备字段对应一组历史搜索量数据,字段如下:

字段名类型说明
yearinteger
monthinteger
dayinteger
search_volumeinteger搜索量

说明:当 period=monthly 时,通常主要使用 yearmonth;当 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 或空数组

使用建议

  1. 批量查询优合并请求:由于按请求计费,建议将多个合并到一次请求中,利用单次最多 1000 个的能力。
  2. 实时场景优 Live:适用于报表页面、实时分析、即时评估等场景。
  3. 非实时任务可用标准模式:如果延迟获取结果,可改用标准任务接口以降低成本。
  4. 谨使用自定义日期区间:平台明确不建议自定义时间范围,建议优使用系统默认周期返回逻辑。
  5. 按设备分析趋势:如需识别移动端与桌面端需求差异,建议指定或拆分 device 参数进行分析。

实用场景

  • 评估季节性:查看某批近 24 个月的月度搜索量变化,用于判断是否存在淡旺季,发布时间规划。
  • 识别设备端流量差异:对比 mobiledesktop 的历史搜索量,帮助制定移动优还是桌面优的 SEO 与投放策略。
  • 验证热点是否短期爆发:通过 dailyweekly 粒度观察最近趋势,快速判断某个话题是否正在升温。
  • 筛选值得布局的:批量提交候选词并比较历史搜索量稳定性,优选择长期有需求、波动可控的。
  • 支撑化选题:结合不同地域和语言参数,分析同一主题在不同国家/语言市场的搜索热度变化,为多地区运营提供依据。

统一入口:官网 · LLM API · 控制台