Skip to content

keywords_data/google/categories

Google 数据分类列表

说明

Google AdWords Keywords Data API 属于旧版能力,现已由 Google Ads API 替代。 如果你当前仍在使用旧版 Google AdWords 接口,建议迁移到 /v3/keywords_data/google_ads/ 容体系。

本接口使用 Google 的商品与服务分类体系,返回可用分类的完整列表,便于在分析、广告分组、行业映射等场景中使用。

你也可以参考官方提供的分类 CSV 文件进行离线处理。

接口信息

  • 请求方式GET
  • 请求地址https://api.seermartech.cn/v3/keywords_data/google/categories

计费说明

调用本接口不收费。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准;该接口通常返回 0

接口用途

调用本接口后,你将获得 Google Ads API 支持的分类列表。

服务端返回标准 JSON 数据,顶层 tasks 数组每个任务本次请求的执行信息和分类结果。

响应结构

字段名类型说明
versionstring当前 API 版本
status_codeinteger局状态码
status_messagestring局提示信息
timestring执行耗时,单位秒
costfloat本次请求总成本,单位 USD
tasks_countintegertasks 数组中的任务数量
tasks_errorintegertasks 数组中返回错误的任务数量
tasksarray任务数组

tasks[] 字段说明

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,通常范围 10000-60000
status_messagestring任务提示信息
timestring任务执行耗时,单位秒
costfloat当前任务成本,单位 USD
result_countintegerresult 数组中的数量
patharrayURL 路径
dataobjectGET 请求 URL 中传的参数
resultarray结果数组

result[] 字段说明

字段名类型说明
category_codeinteger分类编码
category_namestring分类完整名称
category_code_parentinteger上级分类编码

分类层级示例

json
{
 "category_code": 10178,
 "category_name": "Apparel Accessories",
 "category_code_parent": 10021
}

category_code_parent = 10021 对应的上级分类可能为:

json
{
 "category_code": 10021,
 "category_name": "Apparel"
}

这意味着该接口返回的是可用于构建分类树的层级化数据。

请求示例

cURL

bash
curl --location --request GET "https://api.seermartech.cn/v3/keywords_data/google/categories" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"

Python

python
import requests

url = "https://api.seermartech.cn/v3/keywords_data/google/categories"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json)

TypeScript

ts
import axios from "axios";

async function getCategories {
 const response = await axios.get(
 "https://api.seermartech.cn/v3/keywords_data/google/categories",
 {
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json",
 },
 }
 );

 // 返回分类列表结果
 console.log(response.data);
}

getCategories.catch(console.error);

响应示例

json
{
 "version": "3.20191128",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.4305 sec.",
 "cost": 0,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "keywords_data",
 "function": "categories",
 "se": "google"
 },
 "result": []
 }
 ]
}

状态码说明

你需要重点两层状态:

  • 顶层 status_code:表示整个请求是否成功
  • tasks[].status_code:表示单个任务是否成功

常见成功状态码:

状态码含义
20000请求成功

如需排查错误,请结合:

  • status_code
  • status_message
  • tasks[].status_code
  • tasks[].status_message

进行诊断。

使用建议

  • 该接口适合做分类字初始化,无需高频重复请求
  • 可将返回结果缓存到本地数据库,用于分类映射
  • 通过 category_code_parent 可重建完整分类层级
  • 当你需要按行业、品类、父子分类做筛选时,这个接口可作为基础数据来源

实用场景

  • 构建分类树:拉取分类并按 category_code_parent 建立父子,便于在后台系统中提供行业选择器或树状筛选器。
  • 映射行业属性:将研究结果归对应商品或服务分类,帮助团队按品类拆分 SEO 策略。
  • 规范广告分组:使用统一分类编码管理与广告主题,减少人工命名不一致带来的投放混乱。
  • 支持报表分层统计:按一级、二级、叶子分类汇总数据,快速识别高价值行业板块。
  • 初始化本地数据仓库:将分类表缓存到数据库,为后续分析、推荐和自动标注提供基础字。

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