Skip to content

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 请求,无需请求体。

响应字段

顶层字段

字段类型说明
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当前请求的 URL 路径
dataobjectGET 请求中使用的接口参数信息
resultarray分类结果数组

data 字段

字段类型说明
apistringAPI 模块名称,固定为 keywords_data
functionstring接口名称,固定为 categories
sestring搜索引擎名称,固定为 bing

result 分类字段

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

例如:

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

category_code_parent10021,对应的上级分类为:

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_codecategory_code_parent 创建 SEO 或广告数据平台中的多级筛选功能。
  • 统一报表维度:以分类编码作为稳定维度汇总、广告投放和流量数据,提升跨时间报表的一致性。
  • 校验分类参数:在提交数据任务前检查分类编码是否属于当前支持的分类范围,减少参数错误。

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