主题
按任务 ID 获取 Google 拓展结果
本接口使用 GET 方法和以下路径:
/v3/keywords_data/google/keywords_for_keywords/task_get/$id
Google AdWords 数据接口属于旧版接口,现已由 Google Ads API 替代。本接口用于根据指定获取建议,单个任务最多支持 200 个。返回结果竞争度、每次点击费用、月均搜索量及近 12 个月的月度搜索数据。
由于 Google Ads 会结合账户历史、广告素材及账户因素生成结果,接口返回的数据可能与规划师界面中的估算值存在差异。
请求方式
http
GET https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/task_get/$id路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。任务创建后 30 天可以随时使用该 ID 获取结果。 |
计费说明
- 创建任务时计费。
- 任务结果可在创建后的 30 天获取。
- 该查询接口通常不产生额外任务费用。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
响应结构
接口返回 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 | 结果数组。 |
data 对象
data 对象会返回创建任务时提交的主要参数,例如:
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 类型,例如 keywords_data。 |
function | string | 功能名称,例如 keywords_for_keywords。 |
se | string | 搜索引擎,例如 google。 |
language_code | string | 语言代码。 |
location_code | integer | 地理位置代码。 |
keywords | array | 创建任务时提交的列表。 |
tag | string | 用户自定义任务标签。 |
result 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的。 |
location_code | integer | 地理位置代码;无数据时为 null。 |
language_code | string | 语言代码;无数据时为 null。 |
search_partners | boolean | 是否搜索合作伙伴网络的数据。 |
competition | float | 付费搜索结果中的相对竞争度,取值范围为 0 至 1;无数据时为 null。 |
cpc | float | 历史平均每次点击费用;无数据时为 null。 |
search_volume | integer | 月均搜索量,即指定地理位置下该的月均估算搜索次数;无数据时为 null。 |
categories | array | 产品和服务分类;无数据时为 null。 |
monthly_searches | array | 近 12 个月的月度搜索量;无数据时为 null。 |
monthly_searches 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
search_volume | integer | 当月估算搜索量。 |
请求示例
cURL
bash
id="02031624-0696-0107-0000-ee2653ba89d9"
curl --location --request GET \
"https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/task_get/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios
.get(
`https://api.seermartech.cn/v3/keywords_data/google/keywords_for_keywords/task_get/${taskId}`,
{
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);
});Python
python
import requests
task_id = "02231934-2604-0066-2000-570459f04879"
url = (
"https://api.seermartech.cn/v3/keywords_data/google/"
f"keywords_for_keywords/task_get/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
if response.ok:
# 处理接口返回的任务结果
print(response.json())
else:
# 输出 HTTP 错误及接口返回信息
print(response.status_code, response.text)响应示例
json
{
"version": "0.1.20200130",
"status_code": 20000,
"status_message": "Ok.",
"time": "5.0565 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02031624-0696-0107-0000-ee2653ba89d9",
"status_code": 20000,
"status_message": "Ok.",
"time": "5.0123 sec.",
"cost": 0,
"result_count": 4,
"path": [
"v3",
"keywords_data",
"google",
"keywords_for_keywords",
"task_get"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_keywords",
"se": "google",
"language_code": "en",
"location_code": 2840,
"keywords": [
"adsense"
],
"tag": "tag1"
},
"result": [
{
"keyword": "google adsense",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.1818930929,
"cpc": 1.858456,
"search_volume": 110000,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 110000
}
]
},
{
"keyword": "adsense",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.1002443153,
"cpc": 1.427514,
"search_volume": 110000,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 110000
}
]
},
{
"keyword": "prospect",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.0032797439,
"cpc": 4.623882,
"search_volume": 90500,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 90500
}
]
},
{
"keyword": "mlm",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"competition": 0.0460999497,
"cpc": 5.00388,
"search_volume": 90500,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 90500
}
]
}
]
}
]
}状态码与异常处理
建议客户端同时检查以下状态:
- HTTP 状态码是否表示请求成功。
- 顶层
status_code是否为成功状态。 tasks_error是否大于0。- 每个任务的
status_code是否为成功状态。 - 任务成功时
result是否存在且不为null。
当任务返回错误时,应记录对应的 status_code 和 status_message,并根据业务需要执行重试、告警或任务失败处理。
实用场景
- 扩展种子:根据核心词批量获取,扩大 SEO规划和库覆盖范围。
- 筛选低竞争:结合
competition、search_volume和cpc指标,优选择更适合自然搜索增长的词。 - 规划主题集群:按和搜索量组织主题,构建支柱页、专题页及长尾结构。
- 分析季节性:利用
monthly_searches对比近 12 个月趋势,安排季节性页面、活动页和发布时间。 - 评估商业价值:结合搜索量与每次点击费用,识别较高广告价值和转化潜力的。