> ## 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.

# 行业来源平台变化趋势

> 查询指定品牌在指定时间范围内行业引用来源按网站类型的变化趋势，按网站类型分组返回每日的平台数量、URL 数量、引用次数及占比，用于观察不同来源渠道类型随时间的变化。websiteType 为空时归入「未知」。

查询指定品牌在指定时间范围内行业引用来源按网站类型的变化趋势，按网站类型分组返回每日的平台数量、URL 数量、引用次数及占比，用于观察不同来源渠道类型随时间的变化。websiteType 为空时归入「未知」。

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

## 接口速查

| 项目 | 当前接口约定 |
| - | - |
| 接口状态 | 已上线 |
| 请求方式 | `POST` |
| 请求地址 | `https://geobaseapi.aibase.com/v1/openapi/execute` |
| 业务标识 | `source.industry.website.type.trend` |
| 执行模式 | **SYNC · 实时请求**（直接返回，无需轮询） |
| 身份认证 | Header `AIBase-API-Key` |
| 请求格式 | `application/json` |
| 返回结构 | 按网站类型（websiteType）分组（键 → 统计数组），无数据时为空对象 `{}` |

## 请求头

**AIBase-API-Key** `string` *required*

开发者 API Key，例如 `AIBase_xxx`。用于身份认证、有效期与调用权限校验，请仅在服务端保存和使用。

**Content-Type** `string` *required*

固定为 `application/json`。

**AIBase-Request-Id** `string`

开发者自定义请求 ID，用于请求追踪；不传时系统自动生成 UUID。

## 请求体

**apiCode** `string` *required*

固定为 `source.industry.website.type.trend`。

**data** `object` *required*

业务请求参数对象。

**data.brandId** `string` *required*

品牌 ID。所属品牌 ID，为空返回 4001

**data.llmName** `string`

AI平台。按 AI 平台筛选，如 deepseek；不传返回全部平台

**data.startDate** `string`

开始日期。格式 yyyy-MM-dd；默认最近 7 天

**data.endDate** `string`

结束日期。格式 yyyy-MM-dd；默认今天，不能晚于今天

> [!NOTE]
>
> 时间范围规则：startDate/endDate 不传时默认查询最近 7 天；endDate 晚于今天会被自动截断为今天；起止时间跨度最大 6 个月；开始日期晚于结束日期将直接报错。

```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":"source.industry.website.type.trend","data":{"brandId":"brand-001","startDate":"2026-09-01","endDate":"2026-09-23"}}'
```

```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",
}

payload = {
  "apiCode": "source.industry.website.type.trend",
  "data": {
    "brandId": "brand-001",
    "startDate": "2026-09-01",
    "endDate": "2026-09-23"
  }
}

res = requests.post(
    "https://geobaseapi.aibase.com/v1/openapi/execute",
    headers=headers,
    json=payload,
    timeout=60,
)
res.raise_for_status()
body = res.json()

if body["code"] == 200:
    print(body["data"])
```

```javascript Node.js theme={null}
const payload = {
  "apiCode": "source.industry.website.type.trend",
  "data": {
    "brandId": "brand-001",
    "startDate": "2026-09-01",
    "endDate": "2026-09-23"
  }
};

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(payload),
});

const body = await res.json();
if (body.code === 200) {
  console.log(body.data);
}
```

```java Java theme={null}
String body = """
{
  "apiCode": "source.industry.website.type.trend",
  "data": {
    "brandId": "brand-001",
    "startDate": "2026-09-01",
    "endDate": "2026-09-23"
  }
}
""";

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());
```

## 返回参数

业务结果位于 data，为按网站类型（websiteType）分组的结构，每个网站类型对应一组按查询日期排列的趋势点；websiteType 为空时归入「未知」。无数据时 data 为空对象 {}。

**\{websiteType}\[].websiteType** `string`

网站类型。来源网站类型。

**\{websiteType}\[].queryDate** `string`

日期。格式 yyyy-MM-dd。

**\{websiteType}\[].totalPlatformCount** `integer`

平台数量。当日该网站类型下的平台数量。

**\{websiteType}\[].totalPlatformPercentage** `number`

平台占比。当日该网站类型平台占比（%）。

**\{websiteType}\[].urlTotal** `integer`

URL 数量。当日该网站类型下的 URL 总数。

**\{websiteType}\[].urlTotalPercentage** `number`

URL 占比。当日该网站类型 URL 总量占比（%）。

**\{websiteType}\[].totalUrlCite** `integer`

引用总数。当日该网站类型下所有 URL 引用总数。

```json 200 (成功响应) theme={null}
{
  "code": 200,
  "msg": "成功",
  "data": {
    "新闻媒体": [
      {
        "websiteType": "新闻媒体",
        "queryDate": "2026-09-17",
        "totalPlatformCount": 150,
        "totalPlatformPercentage": 29.1,
        "urlTotal": 980,
        "urlTotalPercentage": 26.1,
        "totalUrlCite": 4100
      },
      {
        "websiteType": "新闻媒体",
        "queryDate": "2026-09-23",
        "totalPlatformCount": 156,
        "totalPlatformPercentage": 29.54,
        "urlTotal": 1020,
        "urlTotalPercentage": 26.56,
        "totalUrlCite": 4280
      }
    ],
    "问答社区": [
      {
        "websiteType": "问答社区",
        "queryDate": "2026-09-17",
        "totalPlatformCount": 92,
        "totalPlatformPercentage": 17.8,
        "urlTotal": 610,
        "urlTotalPercentage": 16.2,
        "totalUrlCite": 2050
      }
    ]
  },
  "timeStamp": 1788830174812
}
```

## 接入注意事项

1. apiCode 必须固定为 source.industry.website.type.trend。
2. brandId 为必填参数，为空返回 4001（所需参数不足）。
3. startDate/endDate 格式必须为 yyyy-MM-dd，默认最近 7 天，最大查询跨度 6 个月，endDate 不能晚于今天，开始日期晚于结束日期将直接报错。
4. 返回为「网站类型 → 趋势点数组」的分组对象；无数据时 data 为空对象 {}，解析时做好空值兼容。
5. websiteType 为空时归入「未知」分组。
6. 趋势点按查询日期排列，可用于不同来源渠道类型的变化趋势图表。
7. 各占比字段（totalPlatformPercentage、urlTotalPercentage）为百分比数值，保留 2 位小数。

> [accordion] Java 返回对象
>
> ```java theme={null}
> public class CitationWebsiteDateStat {
>     private String websiteType;
>     private String queryDate;
>     private Integer totalPlatformCount;
>     private BigDecimal totalPlatformPercentage;
>     private Integer urlTotal;
>     private BigDecimal urlTotalPercentage;
>     private Integer totalUrlCite;
> }
> ```
>
> 完整响应类型可表示为 `ReturnResult<Map<String, List<CitationWebsiteDateStat>>>`（`ReturnResult` 定义见 6.2.5）。

> [accordion] TypeScript 类型
>
> ```typescript theme={null}
> export interface CitationWebsiteDateStat {
>   websiteType: string;
>   queryDate: string;
>   totalPlatformCount: number;
>   totalPlatformPercentage: number | null;
>   urlTotal: number;
>   urlTotalPercentage: number | null;
>   totalUrlCite: number;
> }
>
> export type WebsiteTypeDateStatResult = Record<string, CitationWebsiteDateStat[]>;
> ```
>
> 可按以上 TypeScript 类型定义解析响应数据。

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


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