# 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/次
- [抖音直播搜尋](https://okdata.online/zh/apis/douyin/live/rooms/search/) (`douyin.live.rooms.search`): $0.043/次 · 每頁約 10 條結果

## 各 view 返回的欄位

每一級 view 都包含上一級的欄位。`view=compact` 最精簡；`full` 會在 `ext` 里加上平台特有欄位。

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