# LiveRoom

> 直播间此刻的样子：是否在播、标题、主播、开播时间和直播间整体数据。

网页版：https://okdata.online/zh/docs/objects/live_room/

所有平台同一种结构。平台没有的字段为 null，meta.unavailable 会说明原因。用 fields= 只取需要的字段。

| 字段 | 类型 | 说明 |
|---|---|---|
| `id` | string \| null | 直播间 ID，取直播间信息的接口直接用它。平台没给直播间时为 null：账号没在播，或榜单上这一条只链到主播。 |
| `url` | string \| null | 直播间网页地址；平台没有直播间网页时为 null。 |
| `status` | string | live：正在直播；offline：没在播（这时其余字段是平台还保留的上一场的信息）。 |
| `title` | string \| null | 主播设置的直播间标题。 |
| `category` | string \| null | 直播分类或游戏，平台原文（Twitch 的游戏分类、B 站的分区）；平台不给时为 null。 |
| `cover_url` | string \| null | 封面图。 |
| `host` | AccountRef | 主播的公开账号。 |
| `started_at` | string \| null | 本场（或上一场）开播时间，ISO 8601，UTC。 |
| `rank` | integer \| null | 在榜单上的名次，从 1 开始；不是榜单时为 null。 |
| `metrics` | LiveMetrics | 抓取时的直播间整体数据；平台不给的为 null。 |
| `ext` | object | 平台特有字段，只在 view=full 时返回。 |

### AccountRef

| 字段 | 类型 | 说明 |
|---|---|---|
| `id` | string | 平台上的账号 ID。 |
| `username` | string \| null | 用户名（平台有的话）。 |
| `name` | string \| null | 昵称。 |
| `avatar_url` | string \| null | 头像图片地址。 |
| `followers` | integer \| null | 抓取时的粉丝数。 |
| `verified` | boolean \| null | 平台是否显示认证标识。 |

### LiveMetrics

| 字段 | 类型 | 说明 |
|---|---|---|
| `viewers` | integer \| null | 此刻在直播间里的人数。 |
| `total_viewers` | integer \| null | 开播以来进过直播间的人数（累计观看）；平台显示为「10万+」这类时取下限。 |
| `likes` | integer \| null | 开播以来的点赞数。 |
| `heat` | integer \| null | 平台自己给直播间的热度分，不是人数（快手的人气、B站的人气值）。 |
| `products` | integer \| null | 直播间小黄车里在卖的商品数。 |

## 返回 LiveRoom 的接口

- [抖音直播间信息](https://okdata.online/zh/apis/douyin/live/rooms/get/) (`douyin.live.rooms.get`): $0.002/次
- [抖音账号开播状态](https://okdata.online/zh/apis/douyin/live/users/get/) (`douyin.live.users.get`): $0.004/次
- [快手账号开播状态](https://okdata.online/zh/apis/kuaishou/live/users/get/) (`kuaishou.live.users.get`): $0.002/次
- [快手直播榜](https://okdata.online/zh/apis/kuaishou/live/rooms/trending/) (`kuaishou.live.rooms.trending`): $0.002/次 · 每页约 50 条结果
- [视频号开播状态](https://okdata.online/zh/apis/wechat_channels/live/users/get/) (`wechat_channels.live.users.get`): $0.02/次
- [B站直播间信息](https://okdata.online/zh/apis/bilibili/live/rooms/get/) (`bilibili.live.rooms.get`): $0.002/次
- [B站用户开播状态](https://okdata.online/zh/apis/bilibili/live/users/get/) (`bilibili.live.users.get`): $0.002/次
- [TikTok 账号开播状态](https://okdata.online/zh/apis/tiktok/live/users/get/) (`tiktok.live.users.get`): $0.002/次
- [Twitch 主播开播状态](https://okdata.online/zh/apis/twitch/live/users/get/) (`twitch.live.users.get`): $0.004/次
- [视频号直播间详情](https://okdata.online/zh/apis/wechat_channels/live/rooms/get/) (`wechat_channels.live.rooms.get`): $0.02/次

## 各 view 返回的字段

每一级 view 都包含上一级的字段。`view=compact` 最精简；`full` 会在 `ext` 里加上平台特有字段。

- compact：`id`, `url`, `status`, `title`, `category`, `host`, `started_at`, `rank`, `metrics`
- standard：`cover_url`
- full：`ext`
