# 数据分析

## 开发前准备

- **功能了解**：开发前建议先了解电商罗盘商家版的功能和数据指标，可登录 [微信小店电商罗盘](https://channels.weixin.qq.com/compass/product/home) 查看
- **权限与凭证**：商家自研可直接调用，使用小店 access_token；第三方服务商需获得商家对`权限集 ID：175`的授权，使用 authorizer_access_token
- **消息推送配置**：本模块无事件通知，无需配置

## 罗盘数据模型

数据分析接口基于**电商罗盘商家版**，提供店铺经营数据的查询能力。所有接口仅返回 T+1 历史数据（即前一天及更早的数据），暂不支持当日实时数据查询。

### 数据维度

罗盘商家版的数据围绕以下四个维度展开：

```mermaid
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%%
flowchart LR
  A[电商罗盘] --> B[综合数据概览]
  A --> C[商品数据]
  A --> D[带货达人数据]
  A --> E[直播数据]
  style A fill:#ffffff,stroke:#0ab8a6,color:#666666
```

### 数据时效性

| 维度 | 数据粒度 | 时效 | 说明 |
|------|---------|------|------|
| 综合数据概览 | 天 | T+1 | 成交金额/人数/订单数/退款/直播/短视频，含店铺人群画像（性别/年龄/地域/消费力等） |
| 商品数据 | 天 | T+1 | 单品维度的成交/退款/佣金等指标 |
| 带货达人数据 | 天 | T+1 | 达人维度的成交/动销/退款等指标 |
| 直播数据 | 天 | T+1 | 直播场次/时长/封面等信息 |

## 接入流程

### 阶段一：店铺经营数据看板

获取店铺整体经营数据和人群画像，用于构建经营数据看板。

```mermaid
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%%
flowchart LR
  A[指定日期] --> B["[API] 获取电商数据概览<br/>getshopoverall"]
  A --> C["[API] 获取店铺人群数据<br/>getshopsaleprofiledata"]
  B --> D[经营看板]
  C --> D
  style A fill:#ffffff,stroke:#0ab8a6,color:#666666
  style D fill:#ffffff,stroke:#0ab8a6,color:#666666
```

[API] [获取电商数据概览 / getshopoverall](/doc/store/shop/API/compass/api_getshopoverall) 返回成交金额、成交人数、成交订单数、退款金额、直播/短视频成交金额、商品点击人数等核心经营指标。

[API] [获取店铺人群数据 / getshopsaleprofiledata](/doc/store/shop/API/compass/api_getshopsaleprofiledata) 返回用户画像分布数据，支持按 `type` 参数筛选不同用户群体：

| type 值 | 用户群体 |
|---------|---------|
| 1 | 商品曝光用户 |
| 2 | 商品点击用户 |
| 3 | 购买用户 |
| 4 | 首购用户 |
| 5 | 复购用户 |

返回的人群数据维度包括：性别、年龄、省级、地级、购买偏好、策略人群、消费力区间。

### 阶段二：商品数据分析

获取商品维度的销售数据，用于商品运营分析。

```mermaid
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%%
flowchart LR
  A[指定日期] --> B["[API] 获取商品列表<br/>getshopproductlist"]
  B --> C[商品列表 + 汇总数据]
  C --> D{查看单品详情?}
  D -- 是 --> E["[API] 获取商品详细信息<br/>getshopproductdata"]
  E --> F[单品详细指标]
  D -- 否 --> G[列表数据足够]
  style A fill:#ffffff,stroke:#0ab8a6,color:#666666
  style C fill:#ffffff,stroke:#0ab8a6,color:#666666
  style D fill:#ffffff,stroke:#0ab8a6,color:#666666
  style F fill:#ffffff,stroke:#0ab8a6,color:#666666
  style G fill:#ffffff,stroke:#0ab8a6,color:#666666
```

[API] [获取商品列表 / getshopproductlist](/doc/store/shop/API/compass/api_getshopproductlist) 支持分页查询（`limit` + `offset`），默认返回 10 条。每条商品包含成交金额、下单金额、订单数、退款数据及佣金数据等。

[API] [获取商品详细信息 / getshopproductdata](/doc/store/shop/API/compass/api_getshopproductdata) 返回指定商品的完整销售指标，比列表接口多出结算金额（`seller_actual_settle_amount`、`seller_predict_settle_amount`）和更细粒度的退款率（`pay_refund_after_send_ratio`、`pay_refund_before_send_ratio`）等字段。

### 阶段三：带货达人数据分析

获取带货达人维度的经营数据，管理达人合作关系。

```mermaid
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%%
flowchart LR
  A["[API] 获取授权视频号列表<br/>getshopfinderauthorizationlist"] --> B[已授权视频号 ID 列表]
  B --> C["[API] 获取带货达人列表<br/>getshopfinderlist"]
  C --> D[达人列表 + 成交数据]
  D --> E["[API] 获取带货达人详情<br/>getshopfinderproductoverall"]
  E --> F["[API] 获取带货达人商品列表<br/>getshopfinderproductlist"]
  style B fill:#ffffff,stroke:#0ab8a6,color:#666666
  style D fill:#ffffff,stroke:#0ab8a6,color:#666666
```

典型接入路径：

1. 调用 [API] [获取授权视频号列表 / getshopfinderauthorizationlist](/doc/store/shop/API/compass/api_getshopfinderauthorizationlist) 获取店铺已授权的视频号 ID 列表
2. 调用 [API] [获取带货达人列表 / getshopfinderlist](/doc/store/shop/API/compass/api_getshopfinderlist) 获取当日有带货数据的达人列表（`version` 参数传 `v2` 可额外返回 `talent_id`、`mp_id` 等带货者身份信息）
3. 根据达人的 `finder_id`（或 `talent_id`/`mp_id`）调用 [API] [获取带货达人详情 / getshopfinderproductoverall](/doc/store/shop/API/compass/api_getshopfinderproductoverall) 查看达人汇总数据（成交金额、动销商品数、成交人数、退款金额等）。注意：此接口英文名含 `product`，但返回的是**达人整体汇总数据**，而非商品列表，请勿与「获取带货达人商品列表」混淆
4. 调用 [API] [获取带货达人商品列表 / getshopfinderproductlist](/doc/store/shop/API/compass/api_getshopfinderproductlist) 查看该达人带货的具体商品及佣金数据

> [API] [获取带货达人详情 / getshopfinderproductoverall](/doc/store/shop/API/compass/api_getshopfinderproductoverall) 和 [API] [获取带货达人商品列表 / getshopfinderproductlist](/doc/store/shop/API/compass/api_getshopfinderproductlist) 的 `finder_id`、`talent_id`、`mp_id` 三者必填其一。

### 阶段四：直播数据查询

获取店铺直播场次信息，需要先获取视频号 ID。

```mermaid
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#0ab8a6', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#089e8d', 'lineColor': '#0ab8a6', 'secondaryColor': '#07827a', 'secondaryTextColor': '#ffffff', 'secondaryBorderColor': '#055f59', 'tertiaryColor': '#0ab8a6', 'tertiaryTextColor': '#ffffff', 'tertiaryBorderColor': '#089e8d', 'edgeLabelBackground': '#888888', 'fontColor': '#888888'}}}%%
flowchart LR
  A["[API] 获取授权视频号列表<br/>getshopfinderauthorizationlist"] --> B[选择视频号 ID]
  B --> C["[API] 获取店铺开播列表<br/>getshoplivelist"]
  C --> D[直播场次列表]
  style B fill:#ffffff,stroke:#0ab8a6,color:#666666
  style D fill:#ffffff,stroke:#0ab8a6,color:#666666
```

[API] [获取店铺开播列表 / getshoplivelist](/doc/store/shop/API/compass/api_getshoplivelist) 返回指定视频号在指定日期的直播场次信息，包括直播 ID、标题、开播时间（Unix 时间戳）、直播时长和封面图。

## 接口全览

### 必接接口

#### API 接口

| 中文名 / 英文名 | 请求方式 | 功能说明 |
|----------------|---------|---------|
| [获取电商数据概览](/doc/store/shop/API/compass/api_getshopoverall) / getshopoverall | `POST /channels/ec/compass/shop/overall/get` | 获取店铺整体经营数据 |
| [获取店铺人群数据](/doc/store/shop/API/compass/api_getshopsaleprofiledata) / getshopsaleprofiledata | `POST /channels/ec/compass/shop/sale/profile/data/get` | 获取店铺用户画像分布 |
| [获取商品列表](/doc/store/shop/API/compass/api_getshopproductlist) / getshopproductlist | `POST /channels/ec/compass/shop/product/list/get` | 分页查询商品销售数据 |
| [获取商品详细信息](/doc/store/shop/API/compass/api_getshopproductdata) / getshopproductdata | `POST /channels/ec/compass/shop/product/data/get` | 查询单品完整销售指标 |

#### 按需接入

| 中文名 / 英文名 | 请求方式 | 功能说明 |
|----------------|---------|---------|
| [获取带货数据概览](/doc/store/shop/API/compass/api_getshopfinderoverall) / getshopfinderoverall | `POST /channels/ec/compass/shop/finder/overall/get` | 获取带货整体数据 |
| [获取带货达人列表](/doc/store/shop/API/compass/api_getshopfinderlist) / getshopfinderlist | `POST /channels/ec/compass/shop/finder/list/get` | 获取有带货数据的达人列表 |
| [获取带货达人详情](/doc/store/shop/API/compass/api_getshopfinderproductoverall) / getshopfinderproductoverall | `POST /channels/ec/compass/shop/finder/product/overall/get` | 查询单个达人汇总数据（注意：英文名含 product，但返回的是达人整体汇总，非商品列表） |
| [获取带货达人商品列表](/doc/store/shop/API/compass/api_getshopfinderproductlist) / getshopfinderproductlist | `POST /channels/ec/compass/shop/finder/product/list/get` | 查询达人带货的商品及佣金 |
| [获取授权视频号列表](/doc/store/shop/API/compass/api_getshopfinderauthorizationlist) / getshopfinderauthorizationlist | `POST /channels/ec/compass/shop/finder/authorization/list/get` | 获取已授权的视频号列表 |
| [获取店铺开播列表](/doc/store/shop/API/compass/api_getshoplivelist) / getshoplivelist | `POST /channels/ec/compass/shop/live/list/get` | 查询直播场次信息 |

### 全量接口

数据分析（罗盘商家版）共 10 个 API 接口，完整列表请查看官方文档：

- [罗盘商家版 API 接口全量列表](/doc/store/shop/API/compass/)

## 常见问题 FAQ

**Q：获取带货达人列表接口的 version 参数有什么区别？**
A：[API] [获取带货达人列表 / getshopfinderlist](/doc/store/shop/API/compass/api_getshopfinderlist) 的 `version` 参数传 `v2` 时，返回结果会额外包含 `talent_id`（带货者 ID）、`talent_nickname`（带货者昵称）、`mp_id`（公众号 ID）、`mp_nickname`（公众号昵称）等带货者身份信息。不传或传其他值时仅返回 `finder_id` 和 `finder_nickname`。

**Q：[API] [获取带货达人详情 / getshopfinderproductoverall](/doc/store/shop/API/compass/api_getshopfinderproductoverall) 和 [API] [获取带货达人商品列表 / getshopfinderproductlist](/doc/store/shop/API/compass/api_getshopfinderproductlist) 的 finder_id / talent_id / mp_id 如何选择？**
A：这两个接口的 `finder_id`、`talent_id`、`mp_id` 三者必填其一，对应不同的带货者身份标识。`finder_id` 为视频号 ID，可从 [API] [获取带货达人列表 / getshopfinderlist](/doc/store/shop/API/compass/api_getshopfinderlist) 或 [API] [获取授权视频号列表 / getshopfinderauthorizationlist](/doc/store/shop/API/compass/api_getshopfinderauthorizationlist) 获取；`talent_id` 和 `mp_id` 需通过 [API] [获取带货达人列表 / getshopfinderlist](/doc/store/shop/API/compass/api_getshopfinderlist) 的 `v2` 版本获取。

![](https://res8.wxqcloud.qq.com.cn/wxdoc/56617deb-b17d-4cf1-bccd-71d2c41ccc76.svg)文档变更日志（1条）
2026 年 05 月 06 日新增 数据分析 开发指南
