> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aibase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 品牌列表查询

> 查询当前 API Key 所属账号下的品牌列表；不传 brandId 时返回全部品牌，传入则返回单个品牌明细。

品牌列表查询用于获取当前 API Key 所属账号下的品牌资产列表。不传 `brandId` 时返回全部品牌，传入 `brandId` 时返回该品牌的明细。接口固定返回全量列表（不分页），按创建时间倒序排列。

返回的 `id` 是后续接口的关联主键，多数业务接口都需要先通过本接口拿到 `brandId` 再发起调用。

<Info>
  **执行模式：SYNC · 实时请求。**
  请求发出后服务端同步执行业务，结果直接在当前响应的 `data` 中返回，不存在异步任务、无需轮询、无需二次查询。
</Info>

<Warning>
  **注意与 AIBase 开发者文档的同名 `geo.brand` 区分。**
  [AIBase 开发者文档 → GEO 品牌得分检测](/api-reference/brand-score) 中的 `geo.brand` 是品牌得分检测（ASYNC · 异步，入口 `/v1/openapi/tasks`）；本页的 `geo.brand` 是品牌列表查询（SYNC · 实时，入口 `/v1/openapi/execute`）。两者 `apiCode` 同名，但入口、执行模式和返回结构完全不同，请勿混用。
</Warning>

## 接口速查

| 项目 | 当前接口约定 |
| - | - |
| 接口状态 | 已上线 |
| 请求方式 | `POST` |
| 请求地址 | `https://geobaseapi.aibase.com/v1/openapi/execute` |
| 业务标识 | `geo.brand` |
| 执行模式 | **SYNC · 实时请求**（直接返回，无需轮询） |
| 身份认证 | Header `AIBase-API-Key` |
| 请求格式 | `application/json` |
| 返回结构 | 分页结构（`size = -1`，固定返回全量） |

## 请求头

<ParamField header="AIBase-API-Key" type="string" required>
  开发者 API Key，例如 `AIBase_xxx`。用于身份认证、有效期与调用权限校验，请仅在服务端保存和使用。
</ParamField>

<ParamField header="Content-Type" type="string" required>
  固定为 `application/json`。
</ParamField>

<ParamField header="AIBase-Request-Id" type="string">
  开发者自定义请求 ID，用于请求追踪；不传时系统自动生成 UUID。
</ParamField>

## 请求体

<ParamField body="apiCode" type="string" required>
  固定为 `geo.brand`。
</ParamField>

<ParamField body="data" type="object">
  业务请求参数，可为空对象 `{}`；本接口所有业务参数均为可选。
</ParamField>

<ParamField body="data.brandId" type="string">
  品牌 ID。不传返回账号下全部品牌，传入则返回单个品牌明细。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
    --header 'Content-Type: application/json' \
    --header 'AIBase-API-Key: AIBase_xxxxxxxxxxxxxxxx' \
    --header 'AIBase-Request-Id: req-20260924-001' \
    --data '{
      "apiCode": "geo.brand",
      "data": {
        "brandId": "brand-001"
      }
    }'
  ```

  ```python Python theme={null}
  import os
  import requests

  api_key = os.environ["AIBASE_API_KEY"]
  headers = {
      "AIBase-API-Key": api_key,
      "Content-Type": "application/json",
      "AIBase-Request-Id": "req-20260924-001",
  }

  res = requests.post(
      "https://geobaseapi.aibase.com/v1/openapi/execute",
      headers=headers,
      json={"apiCode": "geo.brand", "data": {"brandId": "brand-001"}},
      timeout=60,
  )
  res.raise_for_status()
  payload = res.json()

  if payload["code"] == 200:
      for brand in payload["data"]["records"]:
          print(brand["id"], brand["brandName"])
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://geobaseapi.aibase.com/v1/openapi/execute", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "AIBase-API-Key": process.env.AIBASE_API_KEY,
      "AIBase-Request-Id": "req-20260924-001",
    },
    body: JSON.stringify({
      apiCode: "geo.brand",
      data: { brandId: "brand-001" },
    }),
  });

  const payload = await res.json();
  if (payload.code === 200) {
    for (const brand of payload.data.records) {
      console.log(brand.id, brand.brandName);
    }
  }
  ```

  ```java Java theme={null}
  String body = """
  {
    "apiCode": "geo.brand",
    "data": {
      "brandId": "brand-001"
    }
  }
  """;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://geobaseapi.aibase.com/v1/openapi/execute"))
      .header("Content-Type", "application/json")
      .header("AIBase-API-Key", "AIBase_xxxxxxxxxxxxxxxx")
      .header("AIBase-Request-Id", "req-20260924-001")
      .POST(BodyPublishers.ofString(body))
      .build();

  HttpResponse<String> response = HttpClient.newHttpClient()
      .send(request, BodyHandlers.ofString());
  System.out.println(response.body());
  ```
</RequestExample>

## 返回参数

业务结果位于 `data`，为分页结构，其中 `records` 为品牌列表（本接口固定返回全量，`size = -1`）。

<ResponseField name="records" type="object[]" required>
  品牌明细列表。按创建时间倒序排列，可能为空数组。
</ResponseField>

<ResponseField name="records[].id" type="string" required>
  品牌唯一标识，后续接口通过该 ID 关联。
</ResponseField>

<ResponseField name="records[].brandName" type="string" required>
  品牌名称。
</ResponseField>

<ResponseField name="records[].brandDescription" type="string">
  品牌描述文本。
</ResponseField>

<ResponseField name="records[].productService" type="string[]">
  产品 / 服务列表，可能为空数组。
</ResponseField>

<ResponseField name="records[].targetUser" type="string">
  目标用户群体描述。
</ResponseField>

<ResponseField name="records[].logoUrl" type="string">
  品牌 Logo URL。
</ResponseField>

<ResponseField name="records[].websiteUrl" type="string">
  品牌官网 URL。
</ResponseField>

<ResponseField name="records[].monitorType" type="integer" required>
  监控状态：`1` 开启监控，`0` 关闭监控。
</ResponseField>

<ResponseField name="records[].createTime" type="string" required>
  创建时间，格式 `yyyy-MM-dd HH:mm:ss`。
</ResponseField>

<ResponseField name="records[].monitorTaskName" type="string">
  监控任务名称。
</ResponseField>

<ResponseField name="records[].monitorLlm" type="string">
  参与监控的 AI 平台，逗号分隔字符串，例如 `deepseek,chatgpt`。
</ResponseField>

<ResponseField name="records[].lastMonitorDate" type="string">
  最后监控日期，格式 `yyyy-MM-dd`，可能为 `null`。
</ResponseField>

<ResponseField name="records[].brandKeywords" type="string[]">
  品牌监控关键词列表，可能为空数组。
</ResponseField>

<ResponseField name="records[].expireDate" type="string">
  监控到期日，格式 `yyyy-MM-dd`，可能为 `null`。
</ResponseField>

<ResponseField name="records[].processStatus" type="integer" required>
  内部处理状态：`0` 正常，`1` 表示尚无查询数据。
</ResponseField>

<ResponseField name="records[].queryFrequencyDay" type="integer">
  监控查询频率（天），可能为 `null`。
</ResponseField>

<ResponseField name="records[].nextMonitorDate" type="string">
  下次监控日期，格式 `yyyy-MM-dd`。停止监控时为 `-`，下次监控日晚于到期日时为 `已过期`。
</ResponseField>

<ResponseField name="total" type="integer" required>
  记录总数。
</ResponseField>

<ResponseField name="size" type="integer" required>
  每页条数。本接口固定返回全量，值为 `-1`。
</ResponseField>

<ResponseField name="current" type="integer" required>
  当前页码。
</ResponseField>

<ResponseField name="pages" type="integer" required>
  总页数。
</ResponseField>

<ResponseExample>
  ```json 200 (成功响应) theme={null}
  {
    "code": 200,
    "msg": "成功",
    "data": {
      "records": [
        {
          "id": "brand-001",
          "brandName": "某某品牌",
          "brandDescription": "品牌描述文本",
          "productService": ["智能硬件", "SaaS 服务"],
          "targetUser": "目标用户群体",
          "logoUrl": "https://cdn.example.com/logo.png",
          "websiteUrl": "https://www.example.com",
          "monitorType": 1,
          "createTime": "2026-09-20 10:00:00",
          "monitorTaskName": "默认监控任务",
          "monitorLlm": "deepseek,chatgpt",
          "lastMonitorDate": "2026-09-23",
          "brandKeywords": ["品牌词A", "品牌词B"],
          "expireDate": "2026-12-31",
          "processStatus": 0,
          "queryFrequencyDay": 1,
          "nextMonitorDate": "2026-09-24"
        }
      ],
      "total": 1,
      "size": -1,
      "current": 1,
      "pages": 1
    },
    "timeStamp": 1788830174812
  }
  ```
</ResponseExample>

## 接入注意事项

1. **固定业务标识**：`apiCode` 必须填写 `geo.brand`。
2. **凭证安全**：`AIBase-API-Key` 属于敏感凭证，应仅在服务端使用，不要暴露到浏览器前端、移动端 App 或公开代码仓库。
3. **参数全部可选**：不传 `brandId` 即返回账号下全部品牌；`data` 也可整体传空对象 `{}`。
4. **不分页**：接口固定返回全量列表，`size = -1`，无需也无法传入分页参数。
5. **排序固定**：返回结果按创建时间倒序排列。
6. **数组字段**：`productService`、`brandKeywords` 为数组，请按数组解析，可能为空数组。
7. **非日期文本**：`nextMonitorDate` 可能出现 `-`、`已过期` 等非日期文本，不要强制按日期解析。
8. **监控状态**：`monitorType = 1` 表示开启监控，`0` 表示关闭。
9. **空值兼容**：解析时请对 `data`、`records` 做好 `null` / 空数组兼容。

<AccordionGroup>
  <Accordion title="Java 返回对象">
    ```java theme={null}
    public class ReturnResult<T> {
        private Integer code;
        private String msg;
        private T data;
        private Long timeStamp;
    }

    public class PageResult<T> {
        private List<T> records;
        private Long total;
        private Integer size;
        private Integer current;
        private Integer pages;
    }

    public class BrandData {
        private String id;
        private String brandName;
        private String brandDescription;
        private List<String> productService;
        private String targetUser;
        private String logoUrl;
        private String websiteUrl;
        private Integer monitorType;
        private String createTime;
        private String monitorTaskName;
        private String monitorLlm;
        private LocalDate lastMonitorDate;
        private List<String> brandKeywords;
        private LocalDate expireDate;
        private Integer processStatus;
        private Integer queryFrequencyDay;
        private String nextMonitorDate;
    }
    ```

    完整响应类型可表示为 `ReturnResult<PageResult<BrandData>>`。
  </Accordion>

  <Accordion title="TypeScript 类型">
    ```typescript theme={null}
    export interface ReturnResult<T> {
      code: number;
      msg: string;
      data: T | null;
      timeStamp: number;
    }

    export interface PageResult<T> {
      records: T[];
      total: number;
      size: number;
      current: number;
      pages: number;
    }

    export interface BrandData {
      id: string;
      brandName: string;
      brandDescription: string | null;
      productService: string[];
      targetUser: string | null;
      logoUrl: string | null;
      websiteUrl: string | null;
      monitorType: number;
      createTime: string;
      monitorTaskName: string | null;
      monitorLlm: string | null;
      lastMonitorDate: string | null;
      brandKeywords: string[];
      expireDate: string | null;
      processStatus: number;
      queryFrequencyDay: number | null;
      nextMonitorDate: string | null;
    }
    ```

    可按以上类型定义解析响应数据，完整响应类型为 `ReturnResult<PageResult<BrandData>>`。
  </Accordion>
</AccordionGroup>

<Note>
  本页的 cURL 与 Java 示例来自官方接口文档；Python 与 Node.js 示例为等价转写，未经服务端联调，请以实际返回结果为准。
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.