主题
Google 推荐(Live)
接口说明
该接口用于根据你提供的一组,实时获取平台广告系统推荐的。
你最多可以一次提交 200 个,接口会返回与这些词的推荐词,以及对应的竞价与搜索量指标,如:
search_volume:月均搜索量competition:付费竞争度cpc:历史平均点击成本monthly_searches:近 12 个月月度搜索量
如果你的业务需要实时返回结果,应使用当前的 实时(Live)接口。与标准任务模式不同,Live 模式无需分开发起 POST 和 GET 请求,一次请求即可直接获得结果。
如果你对实时性要求不高,也可以使用标准模式 /v3/keywords_data/google/keywords_for_keywords/task_post/,通常成本更低;扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
说明:
- 该数据能力属于较早版本的广告数据接口体系,现已逐步由新版广告接口体系替代。
- API 返回结果可能与广告平台界面中的规划略有差异,因为返回值会受到账户历史、创意、投放环境等因素影响。
- 如需查看搜索量数据的更新状态,可使用
/v3/keywords_data/google/adwords_status/。
请求信息
HTTP 方法:POST请求地址:https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/live
计费说明
该接口按请求计费。
原文未提供固定单价,因此无法直接换算参考人民币价格。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
接口调用频率上限为:
- 最多 2000 次 API 调用 / 分钟
请求体格式
所有 POST 数据使用 JSON(UTF-8) 格式提交。
请求体是 JSON 数组,格式如下:
json
[
{
"location_name": "United States",
"language_name": "English",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
"tag": "tag1"
}
]请求参数
| 字段名 | 类型 | 说明 |
|---|---|---|
keywords | array | 填。数组,最多 200 个。系统会将提交的自动转换为小写,并在结果中以独立数组返回。 |
location_name | string | 可选。搜索引擎地区完整名称。使用该字段时,无需再传 location_code 或 location_coordinate。可通过 /v3/keywords_data/google/locations 获取可用地区列表。不传则返回结果。示例:London,England,United Kingdom |
location_code | integer | 可选。搜索引擎地区编码。使用该字段时,无需再传 location_name 或 location_coordinate。可通过 /v3/keywords_data/google/locations 获取地区编码。不传则返回结果。示例:2840 |
location_coordinate | string | 可选。地理坐标,格式为 "latitude,longitude"。使用该字段时,无需再传 location_name 或 location_code。返回结果按该坐标所属国家提供。不传则返回结果。示例:52.6178549,-155.352142 |
language_name | string | 可选。搜索引擎语言名。使用该字段时,无需再传 language_code。可通过 /v3/keywords_data/google/languages 获取语言列表。不传则返回所有可用语言结果。示例:English |
language_code | string | 可选。搜索引擎语言代码。使用该字段时,无需再传 language_name。可通过 /v3/keywords_data/google/languages 获取语言代码列表。不传则返回所有可用语言结果。示例:en |
search_partners | boolean | 可选。是否搜索合作伙伴网络数据。传 true 时,结果将同时 Google 与搜索合作伙伴数据。默认值:false |
sort_by | string | 可选。结果排序字段支持按 search_volume 或 relevance 降序排序。默认值:search_volume |
keywords_negative | array | 可选。排除词数组。结果中会忽略这些词。最多可排除 200 个词。系统会自动转换为小写。 |
closely_variants | boolean | 可选。是否返回与高度的结果。传 true 时,keywords_negative 不能与已提交相同。默认值:false |
tag | string | 可选。用户自定义任务标识,最长 255 个字符。可用于结果匹,响应中的 data 对象会原样返回该值。 |
响应结构
接口返回 JSON 数据,顶层 tasks 数组。
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码。完整错误码请参考 /v3/appendix/errors |
status_message | string | 通用状态信息 |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总费用,单位 USD |
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 | 当前任务费用,单位 USD |
result_count | integer | result 数组数量 |
path | array | 接口路径 |
data | object | 与请求中提交的参数一致 |
result | array | 推荐结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的推荐 |
location_code | integer | 请求中的地区编码;无数据时为 null |
language_code | string | 请求中的语言代码;无数据时为 null |
search_partners | boolean | 响应是否合作伙伴网络数据 |
competition | float | 付费搜索竞争度,取值范围 0 到 1;无数据时为 null |
cpc | float | 历史平均点击成本,单位 USD;无数据时为 null |
search_volume | integer | 月均搜索量;无数据时为 null |
categories | array | 产品与服务分类;无数据时为 null |
monthly_searches | array | 近 12 个月月度搜索量数据;无数据时为 null |
monthly_searches[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
search_volume | integer | 该月搜索量 |
请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/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"
],
"tag": "tag1"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
data = [
{
"location_name": "United States",
"language_name": "English",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
"tag": "tag1"
}
]
response = requests.post(url, headers=headers, json=data)
print(response.json)TypeScript
typescript
import axios from "axios";
const postData = [
{
location_name: "United States",
language_name: "English",
keywords: [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
tag: "tag1"
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: postData
})
.then((response) => {
// 输出接口结果
console.log(response.data);
})
.catch((error) => {
console.error(error);
});响应示例
以下示例基于原始文档整理,结构保持一致,部分缺失片段已按标准 JSON 形式补。
json
{
"version": "0.1.20200130",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "018c9f4e-7b7b-4e62-9f1f-2b5f40f6a001",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"result_count": 5,
"path": [
"v3",
"keywords_data",
"google",
"keywords_for_keywords",
"live"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_keywords",
"se": "google",
"location_name": "United States",
"language_name": "English",
"keywords": [
"average page rpm adsense",
"adsense blank ads how long",
"leads and prospects"
],
"tag": "tag1"
},
"result": [
{
"keyword": "google adsense",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.1818930929281237,
"cpc": 1.858456,
"search_volume": 110000,
"categories": [],
"monthly_searches": []
},
{
"keyword": "adsense",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.10024431527022201,
"cpc": 1.427514,
"search_volume": 110000,
"categories": [],
"monthly_searches": []
},
{
"keyword": "prospect",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.0032797439370289166,
"cpc": 4.623882,
"search_volume": 90500,
"categories": [],
"monthly_searches": []
},
{
"keyword": "mlm",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.04609994966369266,
"cpc": 5.00388,
"search_volume": 90500,
"categories": [],
"monthly_searches": []
}
]
}
]
}状态码与错误处理
请重点处理以下两层状态:
- 顶层状态
status_codestatus_message
- 任务级状态
tasks[].status_codetasks[].status_message
建议你的系统对异常状态、空结果、字段为 null 的场景建立完善的容错逻辑。 完整错误码定义请参考 /v3/appendix/errors。
使用建议
- 需要即时推荐词结果时,优使用 实时(Live)接口
- 批量做低成本采集时,可评估标准模式
/v3/keywords_data/google/keywords_for_keywords/task_post/ - 地域、语言、搜索合作伙伴设置会直接影响搜索量与 CPC 数据,建议在同一分析任务中保持条件一致
- 若需要更精确控制结果范围,可组合使用
keywords_negative和closely_variants
实用场景
- 扩展投放词:种子词,快速获取推荐词,提升广告投放或 SEO 选词覆盖率。
- 筛除低价值方向:结合
keywords_negative排除无主题,减少无效流量和生产浪费。 - 评估商业价值:基于
cpc与competition判断商业竞争程度,制定投放优级。 - 识别热点词趋势:通过
monthly_searches观察近 12 个月搜索波动,制定专题与季节性计划。 - 本地化研究:按地区与语言组合查询推荐词,用于不同国家/市场的 SEO 与广告拓词分析。