主题
Bing 搜索量历史数据(实时)
POST /v3/keywords_data/bing/search_volume_history/live
接口说明
POST /v3/keywords_data/bing/search_volume_history/live
本接口用于实时获取最多 1000 个的历史搜索量数据。返回结果支持按月、周或日聚合,并可按设备类型筛选。
Live 模式会在同一次 POST 请求中直接返回结果,无需提交任务、再通过 GET 接口轮询。若不要求实时获取结果,可使用 Standard 模式;Standard 模式需要分别调用任务提交和结果获取接口,但参考价更低。
历史数据最长可查询过去 24 个月。
请求限制
- 单次请求只能 1 个任务。
- 每个任务的
keywords数组最多 1000 个。 - 单个最多 100 个字符。 平台限流以认证说明中的 30/60/120 次/分钟规则为准。
- 无论请求中 1 个还是 1000 个,均按请求计费。
- 会被转换为小写,并在结果中分别返回。
- 请求体使用 UTF-8 编码的 JSON 格式。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
参考价格
参考价约 ¥0.5400 / 次。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
POST 请求体是 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 时填。使用此参数后,无需同时传另外两个位置参数。示例:London,England,United Kingdom。 |
location_code | integer | 条件填 | 搜索引擎位置代码。未指定 location_name 或 location_coordinate 时填。示例:2840。 |
location_coordinate | string | 条件填 | 位置的 GPS 坐标,格式为 "纬度,经度"。未指定 location_name 或 location_code 时填。返回指定坐标所属国家的数据。示例:52.6178549,-155.352142。 |
language_name | string | 条件填 | 搜索引擎语言的完整名称。未指定 language_code 时填。 |
language_code | string | 条件填 | 搜索引擎语言代码。未指定 language_name 时填。 |
device | array | 否 | 指定要查询的设备类型。可选值:mobile、desktop、tablet、non_smartphones。不传时返回所有可用设备类型的数据。 |
period | string | 否 | 返回数据的时间聚合粒度。可选值:monthly、weekly、daily。默认值为 monthly。 |
date_from | string | 否 | 查询时间范围的开始日期,格式为 yyyy-mm-dd,例如 "2020-01-01"。 |
date_to | string | 否 | 查询时间范围的结束日期,格式为 yyyy-mm-dd,例如 "2020-03-15"。 |
tag | string | 否 | 自定义任务标识,用于将请求与结果进行匹,最多 255 个字符。该值会原样返回在响应的 data 对象中。 |
位置与语言参数说明
location_name、location_code、location_coordinate 三只能选择一。
language_name 与 language_code 二只能选择一。
可通过以下接口获取可用的位置和语言列表:
text
GET /v3/keywords_data/bing/search_volume_history/locations_and_languages时间范围规则
period
| 值 | 说明 |
|---|---|
monthly | 按月返回,最多覆盖过去 24 个月。 |
weekly | 按周返回,最多覆盖过去 15 周。 |
daily | 按日返回,最多覆盖过去 45 天。 |
date_from
- 最早可设置为距当前日期 24 个月的日期。
- 如果 Bing 状态接口返回的
actual_data为false,可将开始日期设置为上上个月或更早。 - 如果
actual_data为true,可将开始日期设置为上个月或更早。 - 日期格式为
yyyy-mm-dd。
date_to
- 最早可设置为距当前日期两年的日期。
- 最晚可设置为当前日期的次日。
- 日期格式为
yyyy-mm-dd。
通常不建议使用自定义时间范围。如果同时省略 date_from 和 date_to:
period=monthly:返回过去 24 个月;period=weekly:返回过去 15 周;period=daily:返回过去 45 天。
响应字段
接口返回 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 | 位置代码。无数据时为 null。 |
language_code | string | 语言代码。无数据时为 null。 |
device | string | 请求中指定的设备类型。无数据时为 null。 |
period | string | 数据时间粒度,默认值为 monthly。 |
searches | object | 按设备类型组织的历史搜索量数据。如果未传 device,则返回所有可用设备类型。 |
searches 设备字段
| 字段 | 类型 | 说明 |
|---|---|---|
desktop | array | 桌面设备的历史搜索量数据。 |
non_smartphones | array | 非智能手机或功能手机的历史搜索量数据。 |
mobile | array | 移动设备的历史搜索量数据。 |
tablet | array | 平板设备的历史搜索量数据。 |
每个设备数组中的数据项以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
day | integer | 日期中的日。按月或按周聚合时,部分日期字段可能不适用。 |
search_volume | integer | 对应时间段的搜索量。 |
请求示例
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",
"device": [
"desktop",
"mobile"
]
}
]'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)
response.raise_for_status()
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败:{} {}".format(
result.get("status_code"),
result.get("status_message"),
)
)TypeScript
typescript
const url =
"https://api.seermartech.cn/v3/keywords_data/bing/search_volume_history/live";
const response = await fetch(url, {
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 result = await response.json();
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(result.status_code, result.status_message);
}响应示例
json
{
"version": "0.1.20240626",
"status_code": 20000,
"status_message": "Ok.",
"time": "12.9494 sec.",
"cost": 0.5400,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "12.9000 sec.",
"cost": 0.5400,
"result_count": 1,
"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"
],
"period": "monthly"
},
"result": [
{
"keyword": "average page rpm adsense",
"location_code": 2840,
"language_code": "en",
"device": null,
"period": "monthly",
"searches": {
"desktop": [
{
"year": 2024,
"month": 1,
"day": 1,
"search_volume": 120
}
],
"non_smartphones": [
{
"year": 2024,
"month": 1,
"day": 1,
"search_volume": 10
}
],
"mobile": [
{
"year": 2024,
"month": 1,
"day": 1,
"search_volume": 80
}
],
"tablet": [
{
"year": 2024,
"month": 1,
"day": 1,
"search_volume": 15
}
]
}
}
]
}
]
}实用场景
- 分析季节性趋势:按月、周或日对比搜索量变化,识别旺季与淡季并优化发布节奏。
- 拆分设备端搜索需求:分别比较桌面、移动端、平板和非智能手机的搜索量,为移动端 SEO 和页面适提供依据。
- 评估增长潜力:批量查询候选的历史搜索量,筛选持续增长趋势的词用于规划。
- 制定区域化 SEO 策略:按国家、城市或坐标获取搜索量历史数据,比较不同市场的需求并安排本地化资源。
- 监控业务波动:定期请求核心的历史数据,发现搜索需求异常变化并判断市场或行业趋势。