主题
按任务 ID 获取建议结果
GET /v3/keywords_data/google_ads/keywords_for_keywords/task_get/{id}
本接口通过任务 ID 获取“”任务的结果。请求方式与路径为:
GET /v3/keywords_data/google_ads/keywords_for_keywords/task_get/$id
该接口根据任务创建时提交的,返回由 Google Ads 生成的建议及搜索量、竞争程度、点击单价和历史月度搜索数据。每个任务最多可设置 20 个。任务结果自创建之日起 30 天可重复查询。
请求信息
请求 URL
http
GET https://api.seermartech.cn/v3/keywords_data/google_ads/keywords_for_keywords/task_get/{id}路径参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务唯一标识,UUID 格式。任务创建成功后,可在 30 天使用该 ID 查询结果。 |
请求头
| 请求头 | 类型 | 填 | 说明 |
|---|---|---|---|
Authorization | string | 是 | 使用 Bearer Token 认证,格式为 Bearer smt_live_YOUR_KEY。 |
Content-Type | string | 否 | 建议设置为 application/json。 |
计费说明
本接口用于读取已提交任务的结果,不额外收取结果查询费用。任务创建时产生费用,任务结果可在 30 天查询。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
响应结构
接口返回 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 | 任务结果数组。 |
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 | 建议结果数组。 |
tasks.data 字段
data 对象通常创建任务时提交的请求参数,例如:
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称,例如 keywords_data。 |
function | string | 功能名称,例如 keywords_for_keywords。 |
se | string | 数据来源,例如 google_ads。 |
location_code | integer | 地理位置代码。 |
keywords | array | 创建任务时提交的列表。 |
include_adult_keywords | boolean | 是否成人。 |
tasks.result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的建议。 |
location_code | integer | 地理位置代码。无数据时可能为 null。 |
language_code | string | 语言代码。无数据时可能为 null。 |
search_partners | boolean | 是否 Google 搜索合作伙伴网络。true 表示 Google 及合作伙伴网站,false 表示 Google 搜索网站。 |
competition | string | 付费搜索结果中的竞争程度,可选值为 LOW、MEDIUM、HIGH;未知时为 null。 |
competition_index | integer | 竞争指数,取值范围为 0 至 100。该值根据已填广告位数量与可用广告位总数计算。数据不足时为 null。 |
search_volume | integer | 月均搜索量,为目标地区下的估算值。无数据时为 null。 |
low_top_of_page_bid | float | 广告展示在首页顶部所需的较低出价估算值。 |
high_top_of_page_bid | float | 广告展示在首页顶部所需的较高出价估算值。 |
cpc | float | 每次点击费用估算值。无数据时为 null。 |
monthly_searches | array | 过去 12 个月的月度搜索量数据。无数据时为 null。 |
keyword_annotations | object | 注释信息。 |
keyword_annotations.concepts | array | 对应的概念列表。 |
monthly_searches 字段
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份,取值为 1 至 12。 |
search_volume | integer | 该月份的估算搜索量。 |
keyword_annotations.concepts 字段
| 字段 | 类型 | 说明 |
|---|---|---|
name | string | 概念名称。 |
concept_group | object | 概念所属分组。 |
concept_group.name | string | 概念组名称。 |
concept_group.type | string | 概念组类型。 |
请求示例
curl
bash
task_id="02031624-0696-0107-0000-ee2653ba89d9"
curl --location --request GET \
"https://api.seermartech.cn/v3/keywords_data/google_ads/keywords_for_keywords/task_get/${task_id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02031624-0696-0107-0000-ee2653ba89d9"
url = (
"https://api.seermartech.cn/v3/keywords_data/google_ads/"
f"keywords_for_keywords/task_get/{task_id}"
)
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
response.raise_for_status()
result = response.json()
print(result)TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios
.get(
`https://api.seermartech.cn/v3/keywords_data/google_ads/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);
});PHP
php
<?php
$taskId = '02031624-0696-0107-0000-ee2653ba89d9';
$url = 'https://api.seermartech.cn/v3/keywords_data/google_ads/'
. 'keywords_for_keywords/task_get/' . $taskId;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
print_r($result);C#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
public class Example
{
public static async Task Main()
{
var taskId = "02031624-0696-0107-0000-ee2653ba89d9";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");
var url =
"https://api.seermartech.cn/v3/keywords_data/google_ads/" +
$"keywords_for_keywords/task_get/{taskId}";
var response = await client.GetAsync(url);
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
Console.WriteLine(body);
return;
}
// 处理 JSON 响应
Console.WriteLine(body);
}
}响应示例
以下示例展示了成功响应的主要结构。result 中可大量,示例展示部分结果。
json
{
"version": "0.1.20231117",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02031624-0696-0107-0000-ee2653ba89d9",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"result_count": 3,
"path": [
"v3",
"keywords_data",
"google_ads",
"keywords_for_keywords",
"task_get",
"02031624-0696-0107-0000-ee2653ba89d9"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_keywords",
"se": "google_ads",
"location_code": 2840,
"keywords": [
"qualified leads"
],
"include_adult_keywords": true
},
"result": [
{
"keyword": "qualified leads",
"location_code": 2840,
"language_code": null,
"search_partners": false,
"competition": "LOW",
"competition_index": 11,
"search_volume": 1300,
"low_top_of_page_bid": 3.33,
"high_top_of_page_bid": 26.48,
"cpc": 14.33,
"monthly_searches": [
{
"year": 2023,
"month": 11,
"search_volume": 1300
}
],
"keyword_annotations": {
"concepts": []
}
},
{
"keyword": "get qualified leads",
"location_code": 2840,
"language_code": null,
"search_partners": false,
"competition": "HIGH",
"competition_index": 68,
"search_volume": 10,
"low_top_of_page_bid": 9.77,
"high_top_of_page_bid": 28.0,
"cpc": null,
"monthly_searches": [],
"keyword_annotations": {
"concepts": []
}
},
{
"keyword": "find prospects",
"location_code": 2840,
"language_code": null,
"search_partners": false,
"competition": "LOW",
"competition_index": 33,
"search_volume": 30,
"low_top_of_page_bid": 6.01,
"high_top_of_page_bid": 16.81,
"cpc": 31.26,
"monthly_searches": [],
"keyword_annotations": {
"concepts": []
}
}
]
}
]
}状态码与异常处理
请根据顶层 status_code 和任务级别的 tasks[].status_code 判断请求是否成功:
20000:请求或任务处理成功。40000及以上:任务处理失败或发生错误,应结合status_message定位问题。result为null或空数组:任务可能没有匹数据,或任务处理未完成。
建议在业务系统中同时记录以下信息:
- HTTP 状态码;
- 顶层
status_code; tasks[].status_code;status_message;tasks[].result是否为空;- 响应头
X-SeerMarTech-Charge-CNY返回的扣费金额。
实用场景
- 扩展种子:根据核心词获取,扩大 SEO规划和覆盖范围。
- 筛选主题:结合搜索量与竞争指数筛选优级较高的主题,提升产出比。
- 评估商业价值:使用 CPC、首页顶部低位出价和高位出价识别商业意图较强的,落地页和转化页建设。
- 制定地区化策略:按不同
location_code获取本地搜索需求,为多地区 SEO 和广告投放制定方案。 - 分析季节性趋势:利用
monthly_searches对比过去 12 个月的搜索量变化,安排发布和推广活动节奏。