Skip to content

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

路径参数

参数类型说明
idstring任务唯一标识符,UUID 格式。任务创建后 30 天可以随时使用该 ID 获取结果。

计费说明

  • 创建任务时计费。
  • 任务结果可在创建后的 30 天获取。
  • 该查询接口通常不产生额外任务费用。
  • 实扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

响应结构

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

顶层字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger请求级状态码。完整状态码列表请参考错误码文档。
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结果数组。

data 对象

data 对象会返回创建任务时提交的主要参数,例如:

字段类型说明
apistringAPI 类型,例如 keywords_data
functionstring功能名称,例如 keywords_for_keywords
sestring搜索引擎,例如 google
language_codestring语言代码。
location_codeinteger地理位置代码。
keywordsarray创建任务时提交的列表。
tagstring用户自定义任务标签。

result 数组中的字段

字段类型说明
keywordstring返回的。
location_codeinteger地理位置代码;无数据时为 null
language_codestring语言代码;无数据时为 null
search_partnersboolean是否搜索合作伙伴网络的数据。
competitionfloat付费搜索结果中的相对竞争度,取值范围为 01;无数据时为 null
cpcfloat历史平均每次点击费用;无数据时为 null
search_volumeinteger月均搜索量,即指定地理位置下该的月均估算搜索次数;无数据时为 null
categoriesarray产品和服务分类;无数据时为 null
monthly_searchesarray近 12 个月的月度搜索量;无数据时为 null

monthly_searches 数组中的字段

字段类型说明
yearinteger年份。
monthinteger月份。
search_volumeinteger当月估算搜索量。

请求示例

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
            }
          ]
        }
      ]
    }
  ]
}

状态码与异常处理

建议客户端同时检查以下状态:

  1. HTTP 状态码是否表示请求成功。
  2. 顶层 status_code 是否为成功状态。
  3. tasks_error 是否大于 0
  4. 每个任务的 status_code 是否为成功状态。
  5. 任务成功时 result 是否存在且不为 null

当任务返回错误时,应记录对应的 status_codestatus_message,并根据业务需要执行重试、告警或任务失败处理。

实用场景

  • 扩展种子:根据核心词批量获取,扩大 SEO规划和库覆盖范围。
  • 筛选低竞争:结合 competitionsearch_volumecpc 指标,优选择更适合自然搜索增长的词。
  • 规划主题集群:按和搜索量组织主题,构建支柱页、专题页及长尾结构。
  • 分析季节性:利用 monthly_searches 对比近 12 个月趋势,安排季节性页面、活动页和发布时间。
  • 评估商业价值:结合搜索量与每次点击费用,识别较高广告价值和转化潜力的。

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