主题
历史搜索量(旧版)
本接口使用 POST 方法,请求路径为:
POST https://api.seermartech.cn/v3/dataforseo_labs/historical_search_volume/live
> 本接口为旧版容接口。本平台仍支持该请求与响应结构。新版本接口请参考 /v3/dataforseo_labs/google/historical_search_volume/live/。
接口说明
本接口根据、地区和语言组合,返回 Google 与 Bing 的历史搜索量、当前每次点击费用(CPC)、付费搜索竞争度、广告展示次数及 SERP 信息。
- 支持查询自 2019 年初 起的历史搜索量,可用时间范围取决于、地区和语言组合。
- 数据来源于平台数据库,基础数据来自 Google Ads API 和 Bing Ads API。
- 指标通常在数据源完成更新后每月更新一次。
- Google 可能会重新修订某个月份的搜索量,因此历史数据也可能随之更新。 平台限流以认证说明中的 30/60/120 次/分钟规则为准。
- 所有 POST 请求体使用 UTF-8 编码的 JSON 格式,并以 JSON 数组传递任务。
计费说明
每个请求按任务计费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
响应中的 cost 字段(平台原始 USD 成本兼容字段)表示本次任务的计费金额,金额口径以本平台返回值和响应头为准。
请求参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keywords | array | 是 | 要查询的列表。最多 700 个;每个最多 80 个字符、10 个单词。会转换为小写。若部分未出现在结果中,表示数据库中没有对应数据;未返回的不会计费。 |
location_name | string | 条件填 | 地区完整名称。未指定 location_code 时填,例如 United Kingdom。 |
location_code | integer | 条件填 | 地区代码。未指定 location_name 时填,例如 2840。 |
language_name | string | 条件填 | 语言完整名称。未指定 language_code 时填,例如 English。 |
language_code | string | 条件填 | 语言代码。未指定 language_name 时填,例如 en。 |
include_serp_info | boolean | 否 | 是否返回每个的 SERP 数据结果数量、检查 URL 和 SERP 特征。默认值为 false。 |
order_by | array | 否 | 结果排序规则。支持升序 asc 和降序 desc,多个排序规则最多设置 3 个。排序字段与排序方向使用逗号分隔,例如 search_volume,desc。默认按性排序。relevance 是系统排序标识,不会出现在结果字段中。 |
tag | string | 否 | 用户自定义任务标识,最多 255 个字符。该值会原样返回在响应任务的 data 对象中。 |
location_name 与 location_code 二选一;language_name 与 language_code 二选一。
可通过以下接口查询可用的地区和语言:
GET https://api.seermartech.cn/v3/dataforseo_labs/locations_and_languages
请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/dataforseo_labs/historical_search_volume/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"location_name": "United States",
"language_name": "English",
"include_serp_info": true,
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
]
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/historical_search_volume/live"
payload = [
{
"location_name": "United States",
"language_name": "English",
"include_serp_info": True,
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
]
}
]
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
f"请求失败,错误码:{result.get('status_code')},"
f"错误信息:{result.get('status_message')}"
)TypeScript
typescript
import axios from "axios";
const requestData = [
{
location_name: "United States",
language_name: "English",
include_serp_info: true,
keywords: [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
]
}
];
axios.post(
"https://api.seermartech.cn/v3/dataforseo_labs/historical_search_volume/live",
requestData,
{
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);
});响应结构
接口返回 JSON 对象 tasks 任务数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用状态码。成功时通常为 20000。 |
status_message | string | 通用状态信息。 |
time | string | 请求执行耗时,例如 0.1091 sec.。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | 返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
任务字段
| 字段 | 类型 | 说明 |
|---|---|---|
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 | 查询结果数组。 |
完整错误码可参考 /v3/appendix/errors。建议客户端对请求级和任务级错误分别进行处理。
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
location_code | integer | 请求中使用的地区代码。 |
language_code | string | 请求中使用的语言代码。 |
items_count | integer | items 数组中的结果数量。 |
items | array | 及指标。 |
items 字段
基础字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 。返回时会对编码进行解码,+ 会解码为空格。 |
location_code | integer / null | 对应的地区代码。无数据时为 null。 |
keyword_info | object | Google 指标。 |
keyword_properties | object | 附加信息。 |
impressions_info | object | 广告展示次数数据。 |
bing_keyword_info | object | Bing 指标。部分地区和语言不提供 Bing 数据。 |
serp_info | object / null | SERP 数据。未将 include_serp_info 设置为 true,或数据库中没有该的 SERP 数据时为 null。 |
keyword_info
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 数据更新时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
competition | float | 付费搜索竞争度,取值范围为 0 至 1。 |
cpc | float | 历史平均每次点击费用。 |
search_volume | integer | 平均月搜索量,表示指定在 Google 中的近似搜索次数。 |
categories | array | 产品和服务分类。 |
monthly_searches | array | 过去 12 个月、面向指定地区的月度搜索量。 |
monthly_searches 子项:
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
search_volume | integer | 该月份的平均搜索量。 |
keyword_properties
| 字段 | 类型 | 说明 |
|---|---|---|
core_keyword | string / null | 相似分组中的核心。为 null 时,表示数据库中没有符合条件的核心。 |
keyword_difficulty | integer | 难度,取值范围为 0 至 100,用于衡量自然搜索结果前 10 名的难度。该指标综合分析 SERP 前 10 个页面的链接特征等因素。 |
impressions_info
该对象基于最高出价 999 计算,用于降低账户因素对展示次数估算的影响。daily_impressions 通常可作为 Google 搜索量的补参考。
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 展示次数数据更新时间,UTC 格式。 |
bid | integer | 最高 CPC 出价。本接口通常返回 999。 |
match_type | string | 匹类型,可取 exact、broad 或 phrase。 |
ad_position_min | float | 最低广告排名。 |
ad_position_max | float | 最高广告排名。 |
ad_position_average | float | 平均广告排名。 |
cpc_min | float | 在出价为 999 时估算的最低 CPC。该值不是 CPC; CPC 请读取 keyword_info.cpc。 |
cpc_max | float | 在出价为 999 时估算的最高 CPC。该值不是 CPC。 |
cpc_average | float | 在出价为 999 时估算的平均 CPC。该值不是 CPC。 |
daily_impressions_min | float | 估算的最低日展示次数,可作为搜索量的补参考。 |
daily_impressions_max | float | 估算的最高日展示次数。 |
daily_impressions_average | float | 估算的平均日展示次数。 |
daily_clicks_min | float | 最低日点击次数。 |
daily_clicks_max | float | 最高日点击次数。 |
daily_clicks_average | float | 平均日点击次数。 |
daily_cost_min | float | 最低日广告费用估算值。 |
daily_cost_max | float | 最高日广告费用估算值。 |
daily_cost_average | float | 平均日广告费用估算值。 |
bing_keyword_info
Bing 数据对部分地区和语言可用。
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | Bing 数据更新时间,UTC 格式。 |
search_volume | integer | 过去一个月在 Bing 中的搜索次数。 |
monthly_searches | array | 指定地区下的 Bing 月度搜索量。 |
monthly_searches 子项:
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
search_volume | integer | 月度平均搜索量。 |
serp_info
当请求参数 include_serp_info 为 true 且数据库中存在对应 SERP 数据时返回。
| 字段 | 类型 | 说明 |
|---|---|---|
check_url | string | 对应的搜索结果页 URL,可用于人工核验结果。 |
serp_item_types | array | SERP 中出现的结果类型。结果数据针对 organic、paid、featured_snippet 和 local_pack 返回。 |
se_results_count | string | 搜索结果总数。 |
last_updated_time | string | SERP 数据更新时间,UTC 格式。 |
previous_updated_time | string / null | 上一次 SERP 数据更新时间。 |
响应示例
json
{
"version": "0.1.20220131",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1091 sec.",
"cost": 0.0102,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0850 sec.",
"cost": 0.0102,
"result_count": 1,
"path": [
"v3",
"dataforseo_labs",
"historical_search_volume",
"live"
],
"data": {
"api": "dataforseo_labs",
"function": "historical_search_volume",
"keywords": [
"phone",
"watch"
],
"language_name": "English",
"location_code": 2840,
"include_serp_info": true
},
"result": [
{
"location_code": 2840,
"language_code": "en",
"items_count": 2,
"items": [
{
"keyword": "phone",
"location_code": 2840,
"keyword_info": {
"last_updated_time": "2022-01-17 15:57:45 +00:00",
"competition": 0.9874966013067319,
"cpc": 3.128769,
"search_volume": 450000,
"categories": [],
"monthly_searches": [
{
"year": 2021,
"month": 12,
"search_volume": 450000
}
]
},
"keyword_properties": {
"core_keyword": null,
"keyword_difficulty": 100
},
"impressions_info": {
"last_updated_time": "2021-12-30 21:53:30 +00:00",
"bid": 999,
"match_type": "exact",
"ad_position_min": 1.12,
"ad_position_max": 1.0,
"ad_position_average": 1.06,
"cpc_min": 13.11,
"cpc_max": 16.02,
"cpc_average": 14.57,
"daily_impressions_min": 3682.42,
"daily_impressions_max": 4500.73,
"daily_impressions_average": 4091.57,
"daily_clicks_min": 118.16,
"daily_clicks_max": 144.42,
"daily_clicks_average": 131.29,
"daily_cost_min": 1721.19,
"daily_cost_max": 2103.68,
"daily_cost_average": 1912.43
},
"bing_keyword_info": {
"last_updated_time": "2021-12-19 12:26:54 +00:00",
"search_volume": 54530,
"monthly_searches": []
},
"serp_info": {
"check_url": "https://www.google.com/search?q=phone&num=100&hl=en&gl=US",
"serp_item_types": [
"organic",
"paid",
"featured_snippet"
],
"se_results_count": "3430000000",
"last_updated_time": "2022-01-13 20:59:31 +00:00",
"previous_updated_time": null
}
}
]
}
]
}
]
}实用场景
- 追踪历史趋势:按地区和语言获取自 2019 年以来的月度搜索量,识别季节性需求并规划发布时间。
- 筛选付费搜索机会:结合搜索量、竞争度和 CPC,优选择流量潜力较高且投放成本可控的。
- 评估自然排名难度:使用
keyword_difficulty衡量自然搜索结果前 10 名的难度,制定 SEO优级。 - 预测广告与点击:结合展示次数、点击次数、广告排名和日成本估算,制定搜索广告预算。
- 对比 Google 与 Bing 需求:同时分析
keyword_info和bing_keyword_info,发现不同搜索引擎及市场中的流量差异。