主题
Bing 数据分类列表
接口说明
GET /v3/keywords_data/bing/categories
本接口返回 Bing Ads 支持的完整数据分类列表。调用成功后,响应将以 JSON 格式返回,并通过 tasks 数组提供分类信息。
计费说明
本接口调用,不产生接口费用。响应中的 cost 字段(平台原始 USD 成本兼容字段)通常为 0。
如账户存在特殊计费规则,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求方式
http
GET https://api.seermartech.cn/v3/keywords_data/bing/categories
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json本接口为 GET 请求,无需请求体。
响应字段
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用响应状态码 |
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 | 当前请求的 URL 路径 |
data | object | GET 请求中使用的接口参数信息 |
result | array | 分类结果数组 |
data 字段
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称,固定为 keywords_data |
function | string | 接口名称,固定为 categories |
se | string | 搜索引擎名称,固定为 bing |
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 为 10021,对应的上级分类为:
json
{
"category_code": 10021,
"category_name": "Apparel"
}响应示例
json
{
"version": "3.20191128",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.4305 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1200 sec.",
"cost": 0,
"result_count": 2,
"path": [
"v3",
"keywords_data",
"bing",
"categories"
],
"data": {
"api": "keywords_data",
"function": "categories",
"se": "bing"
},
"result": [
{
"category_code": 10021,
"category_name": "Apparel",
"category_code_parent": 0
},
{
"category_code": 10178,
"category_name": "Apparel Accessories",
"category_code_parent": 10021
}
]
}
]
}错误处理
建议同时检查顶层 status_code 和任务级 tasks[].status_code:
20000:请求成功- 非
20000:请求或任务处理失败,应结合对应的status_message排查
代码示例
cURL
bash
curl --location --request GET \
"https://api.seermartech.cn/v3/keywords_data/bing/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/bing/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:
for task in result.get("tasks", []):
if task.get("status_code") == 20000:
for category in task.get("result", []):
print(category)
else:
print(
"请求失败,错误码:%s,错误信息:%s"
% (result.get("status_code"), result.get("status_message"))
)TypeScript
typescript
import axios from "axios";
axios
.get("https://api.seermartech.cn/v3/keywords_data/bing/categories", {
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
})
.then((response) => {
const result = response.data;
if (result.status_code === 20000) {
console.log("分类列表:", result.tasks);
} else {
console.error(
`请求失败,错误码:${result.status_code},错误信息:${result.status_message}`
);
}
})
.catch((error) => {
console.error("网络或服务异常:", error.message);
});实用场景
- 获取完整分类树:同步 Bing Ads 的分类编码与上下级,为广告账户搭建标准化行业分类体系。
- 匹行业:将研究结果映射到对应分类,支持按行业聚合搜索需求和规模。
- 构建分类筛选器:使用
category_code和category_code_parent创建 SEO 或广告数据平台中的多级筛选功能。 - 统一报表维度:以分类编码作为稳定维度汇总、广告投放和流量数据,提升跨时间报表的一致性。
- 校验分类参数:在提交数据任务前检查分类编码是否属于当前支持的分类范围,减少参数错误。