主题
Google Ads 拓展(实时)
POST /v3/keywords_data/google_ads/keywords_for_keywords/live
接口说明
本接口使用 POST 方法,路径为:
/v3/keywords_data/google_ads/keywords_for_keywords/live
根据指定的获取建议及核心指标。单次请求最多提交 20 个,最多可返回 20,000 条建议。
本接口基于最新版 Google Ads API。历史数据最长支持查询近 4 年。
> 调用限制 > > - 每个账户通过 Google Ads 实时接口每分钟最多发送 12 个请求。 > - 每次实时 API 请求只能 1 个任务。 > - 账户整体每分钟最多可发送 2,000 次 API 调用。 > - 无论返回多少条,每次请求均会计费。
计费说明
参考价约 ¥0.54 / 次。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求体使用 UTF-8 编码的 JSON 数组格式:
json
[
{
"keywords": ["seo tools", "keyword research"],
"location_name": "United States",
"language_code": "en"
}
]任务参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keywords | array | 是 | 用于获取的种子列表。最多 20 个;每个最长 80 个字符。平台会将转换为小写。部分组合可能没有返回数据。Google Ads 不使用部分特殊符号、Unicode 符号或表字符。 |
location_name | string | 否 | 搜索地域的完整名称,例如 London,England,United Kingdom。未指定时返回范围结果。使用此参数时,无需同时传 location_code 或 location_coordinate。可通过 /v3/keywords_data/google_ads/locations 获取可用地域。 |
location_code | integer | 否 | 搜索地域编码,例如 2840。未指定时返回范围结果。使用此参数时,无需同时传 location_name 或 location_coordinate。 |
location_coordinate | string | 否 | 地理坐标,格式为 "纬度,经度",例如 52.6178549,-155.352142。数据将该坐标所属国家提供。使用此参数时,无需同时传 location_name 或 location_code。 |
language_name | string | 否 | 搜索语言的完整名称,例如 English。可通过 /v3/keywords_data/google_ads/languages 获取可用语言。 |
language_code | string | 否 | 搜索语言编码,例如 en。可通过 /v3/keywords_data/google_ads/languages 获取可用语言编码。 |
search_partners | boolean | 否 | 是否 Google 搜索合作伙伴网络的数据。true 表示 Google 自有、运营及合作伙伴搜索网络;false 返回 Google 搜索网站数据。默认值为 false。 |
date_from | string | 否 | 数据起始日期,格式为 yyyy-mm-dd。最早可设置为当前日期前 4 年。未指定时默认查询过去 12 个月。该日期不能晚于 date_to 或昨天。 |
date_to | string | 否 | 数据结束日期,格式为 yyyy-mm-dd,例如 "2022-11-30"。不能晚于昨天。未指定时默认使用昨天。 |
sort_by | string | 否 | 返回结果的排序字段,支持 relevance、search_volume、competition_index、low_top_of_page_bid、high_top_of_page_bid。结果按降序排列。默认值为 relevance。 |
include_adult_keywords | boolean | 否 | 是否返回与成人的。默认值为 false。即使设为 true,Google Ads 仍可能因政策限制而不返回数据。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。可用于请求与响应,指定的值会原样返回在响应的 data 对象中。 |
日期限制
如果状态接口 /v3/keywords_data/google_ads/status 返回的 actual_data 为:
false:date_from最早可设置为上上个月及更早日期;true:date_from最早可设置为上个月及更早日期。
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/keywords_data/google_ads/keywords_for_keywords/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"location_name": "United States",
"language_code": "en",
"keywords": [
"seo tools",
"keyword research"
],
"search_partners": false,
"sort_by": "relevance"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/google_ads/keywords_for_keywords/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
# 请求体是 JSON 数组
payload = [
{
"location_name": "United States",
"language_code": "en",
"keywords": [
"seo tools",
"keyword research"
],
"search_partners": False,
"sort_by": "relevance"
}
]
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,错误码:{},错误信息:{}".format(
result.get("status_code"),
result.get("status_message")
)
)TypeScript
typescript
import axios from "axios";
const payload = [
{
location_name: "United States",
language_code: "en",
keywords: ["seo tools", "keyword research"],
search_partners: false,
sort_by: "relevance",
},
];
axios
.post(
"https://api.seermartech.cn/v3/keywords_data/google_ads/keywords_for_keywords/live",
payload,
{
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 | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务总数。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
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 | 当前请求的 URL 路径信息。 |
data | object | 请求时提交的参数。 |
result | array | 建议结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的。 |
location_code | integer | 地域编码。无数据时为 null。 |
language_code | string | 语言编码。无数据时为 null。 |
search_partners | boolean | 是否 Google 搜索合作伙伴网络。 |
competition | string | 付费搜索结果中的竞争程度。可选值:LOW、MEDIUM、HIGH;未知时为 null。 |
competition_index | integer | 竞争指数,取值范围为 0 至 100。根据已填广告位数量与可用广告位总数计算。数据不足时为 null。 |
search_volume | integer | 月均搜索量,为近似值。无数据时为 null。 |
low_top_of_page_bid | float | 广告展示在搜索结果首页顶部所需的较低出价估算值。该值约高于广告展示所需最低出价的 20%。 |
high_top_of_page_bid | float | 广告展示在搜索结果首页顶部所需的较高出价估算值。该值约高于广告展示所需最低出价的 80%。 |
cpc | float | 每次点击费用估算值。 |
monthly_searches | array | 过去 12 个月的月度搜索量数据。无数据时为 null。 |
keyword_annotations | object | 注释信息。 |
keyword_annotations.concepts | array | 对应的概念列表;无数据时为 null。 |
low_top_of_page_bid、high_top_of_page_bid 和 cpc 可能因请求中指定的地域不同而变化。
monthly_searches 字段
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
search_volume | integer | 该月的搜索量。 |
keyword_annotations.concepts 字段
| 字段 | 类型 | 说明 |
|---|---|---|
name | string | 概念名称。 |
concept_group | object | 概念所属的概念组。 |
concept_group.name | string | 概念组名称。 |
concept_group.type | string | 概念组类型。 |
响应示例
json
{
"version": "0.1.20231117",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.8776 sec.",
"cost": 0.075,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.8000 sec.",
"cost": 0.075,
"result_count": 2,
"path": [
"v3",
"keywords_data",
"google_ads",
"keywords_for_keywords",
"live"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_keywords",
"se": "google_ads",
"location_code": 2840,
"keywords": [
"seo tools"
]
},
"result": [
{
"keyword": "seo tools",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": "MEDIUM",
"competition_index": 55,
"search_volume": 1000,
"low_top_of_page_bid": 1.25,
"high_top_of_page_bid": 4.80,
"cpc": 2.10,
"monthly_searches": [
{
"year": 2023,
"month": 11,
"search_volume": 1000
}
],
"keyword_annotations": {
"concepts": null
}
},
{
"keyword": "adsense rpm average",
"location_code": 2840,
"language_code": null,
"search_partners": false,
"competition": "LOW",
"competition_index": 0,
"search_volume": 20,
"low_top_of_page_bid": null,
"high_top_of_page_bid": null,
"cpc": null,
"monthly_searches": [],
"keyword_annotations": {
"concepts": null
}
}
]
}
]
}状态码与错误处理
请根据顶层 status_code 和任务级 tasks[].status_code 判断请求是否成功:
20000:请求或任务执行成功;- 状态码:请求或任务执行失败,应结合对应的
status_message排查原因。
建议在业务系统中同时处理以下:
- 请求频率 Google Ads 实时接口限制;
- 不支持的特殊字符;
- 指定的地域或语言不存在;
- 日期范围出可用历史数据范围;
- Google Ads 对成人或特定组合不返回数据;
- 返回结果为空或部分字段为
null。
实用场景
- 拓展种子:根据核心词批量获取搜索词,扩大 SEO和落地页的覆盖范围。
- 筛选高价值:结合搜索量、竞争指数和首页顶部出价,优确定流量潜力高且商业价值明确的词。
- 规划主题:利用概念注释和词建议,聚合同一搜索意图下的主题,构建集群。
- 评估地域需求:按国家、城市或坐标查询数据,为本地 SEO 和区域投放制定策略。
- 分析季节性趋势:读取近 12 个月的月度搜索量,识别季节性需求并安排发布或营销活动。