主题
content_analysis/categories
GET /v3/content_analysis/categories
#分析分类列表
接口说明
该接口用于获取分析 API 支持的分类列表。
本接口使用 Google 商品与服务分类体系,返回当前可用于分析的完整分类数据。若需离线处理,也可自行从来源下载对应的 CSV 分类表。
- 请求方式:
GET - 请求地址:
https://api.seermartech.cn/v3/content_analysis/categories - 计费:****
- 说明:调用本接口不会产生费用;扣费以响应头
X-SeerMarTech-Charge-CNY为准
接口返回 JSON 数据 tasks 数组,数组为分类列表结果。
请求信息
HTTP Request
GET /v3/content_analysis/categories
请求头
| 名称 | 类型 | 是否填 | 说明 |
|---|---|---|---|
| Authorization | string | 是 | 使用 Bearer Token 鉴权,格式:Bearer smt_live_YOUR_KEY |
| Content-Type | string | 否 | 固定为 application/json |
响应结构
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 接口整体状态码;完整错误码可参考 /v3/appendix/errors |
status_message | string | 接口整体状态信息;完整说明可参考 /v3/appendix/errors |
time | string | 执行耗时,单位为秒 |
cost | float | 本次请求总费用,单位 USD;本接口通常为 0 |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | tasks 数组中返回错误的任务数量 |
tasks | array | 任务结果数组 |
tasks 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000;完整错误码可参考 /v3/appendix-errors/ |
status_message | string | 任务状态信息;完整说明可参考 /v3/appendix-errors/ |
time | string | 任务执行耗时,单位为秒 |
cost | float | 当前任务费用,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | URL 路径 |
data | object | GET 请求 URL 中传的参数信息 |
result | array | 分类结果数组 |
result 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
category_code | integer | 分类编码 |
category_name | string | 分类完整名称 |
category_code_parent | integer | 上级分类编码 |
分类字段示例
json
{
"category_code": 10178,
"category_name": "Apparel Accessories",
"category_code_parent": 10021
},category_code_parent 表示该分类的父级分类编码,用于构建分类树或层级。
请求示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/content_analysis/categories" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/content_analysis/categories"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
result = response.json
if result.get("status_code") == 20000:
print(result)
else:
print(f'error. Code: {result.get("status_code")} Message: {result.get("status_message")}')TypeScript
typescript
import axios from "axios";
// 获取分析支持的分类列表
axios({
method: "get",
url: "https://api.seermartech.cn/v3/content_analysis/categories",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
})
.then((response) => {
const result = response.data;
console.log(result);
})
.catch((error) => {
console.log(error);
});响应示例
json
{
"version": "0.1.20200305",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0594 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "content_analysis",
"function": "categories"
},
"result": []
}
]
}状态码说明
| 状态码 | 说明 |
|---|---|
20000 | 请求成功 |
10000-60000 | 任务级状态码范围,含义请参考 /v3/appendix/errors 或 /v3/appendix-errors/ |
使用说明
- 本接口适合在接分析能力前,同步平台支持的分类。
- 返回的
category_code_parent可用于建立父子层级,例如生成分类树、筛选某一大类下的所有子类。 - 若你需要将、页面或主题映射到标准行业分类,可通过本接口获取分类字,再结合分析接口进行匹。
- 接口本身不收费,通常响应中的
cost为0。
实用场景
- 同步分类字:定期拉取最新分类列表,保持标签体系与本平台分类标准一致。
- 构建分类树:利用
category_code与category_code_parent生成层级结构,便于前端筛选、后台管理和主题归类。 - 映射站点主题:将网页、文章或产品映射到标准分类,提升分析结果的一致性与可比性。
- 规范数据库:在分析、舆监测或行业研究场景中,统一分类编码,降低后续聚合统计的歧义。
- 行业细分分析:按分类维度拆分表现、覆盖或竞争格局,帮助发现高价值垂直赛道。