Skip to content

按任务 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}

路径参数

参数类型说明
idstring任务唯一标识,UUID 格式。任务创建成功后,可在 30 天使用该 ID 查询结果。

请求头

请求头类型说明
Authorizationstring使用 Bearer Token 认证,格式为 Bearer smt_live_YOUR_KEY
Content-Typestring建议设置为 application/json

计费说明

本接口用于读取已提交任务的结果,不额外收取结果查询费用。任务创建时产生费用,任务结果可在 30 天查询。

扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

响应结构

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger通用响应状态码。20000 表示请求成功。
status_messagestring通用状态说明。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

tasks 数组中的字段

字段类型说明
idstring任务唯一标识,UUID 格式。
status_codeinteger任务状态码,通常在 1000060000 范围。
status_messagestring任务状态说明。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的结果数量。
patharray请求路径信息。
dataobject创建任务时提交的参数。
resultarray建议结果数组。

tasks.data 字段

data 对象通常创建任务时提交的请求参数,例如:

字段类型说明
apistringAPI 模块名称,例如 keywords_data
functionstring功能名称,例如 keywords_for_keywords
sestring数据来源,例如 google_ads
location_codeinteger地理位置代码。
keywordsarray创建任务时提交的列表。
include_adult_keywordsboolean是否成人。

tasks.result 字段

字段类型说明
keywordstring返回的建议。
location_codeinteger地理位置代码。无数据时可能为 null
language_codestring语言代码。无数据时可能为 null
search_partnersboolean是否 Google 搜索合作伙伴网络。true 表示 Google 及合作伙伴网站,false 表示 Google 搜索网站。
competitionstring付费搜索结果中的竞争程度,可选值为 LOWMEDIUMHIGH;未知时为 null
competition_indexinteger竞争指数,取值范围为 0100。该值根据已填广告位数量与可用广告位总数计算。数据不足时为 null
search_volumeinteger月均搜索量,为目标地区下的估算值。无数据时为 null
low_top_of_page_bidfloat广告展示在首页顶部所需的较低出价估算值。
high_top_of_page_bidfloat广告展示在首页顶部所需的较高出价估算值。
cpcfloat每次点击费用估算值。无数据时为 null
monthly_searchesarray过去 12 个月的月度搜索量数据。无数据时为 null
keyword_annotationsobject注释信息。
keyword_annotations.conceptsarray对应的概念列表。

monthly_searches 字段

字段类型说明
yearinteger年份。
monthinteger月份,取值为 112
search_volumeinteger该月份的估算搜索量。

keyword_annotations.concepts 字段

字段类型说明
namestring概念名称。
concept_groupobject概念所属分组。
concept_group.namestring概念组名称。
concept_group.typestring概念组类型。

请求示例

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 定位问题。
  • resultnull 或空数组:任务可能没有匹数据,或任务处理未完成。

建议在业务系统中同时记录以下信息:

  • HTTP 状态码;
  • 顶层 status_code
  • tasks[].status_code
  • status_message
  • tasks[].result 是否为空;
  • 响应头 X-SeerMarTech-Charge-CNY 返回的扣费金额。

实用场景

  • 扩展种子:根据核心词获取,扩大 SEO规划和覆盖范围。
  • 筛选主题:结合搜索量与竞争指数筛选优级较高的主题,提升产出比。
  • 评估商业价值:使用 CPC、首页顶部低位出价和高位出价识别商业意图较强的,落地页和转化页建设。
  • 制定地区化策略:按不同 location_code 获取本地搜索需求,为多地区 SEO 和广告投放制定方案。
  • 分析季节性趋势:利用 monthly_searches 对比过去 12 个月的搜索量变化,安排发布和推广活动节奏。

统一入口:官网 · LLM API · 控制台