2020-04-08 16:20:28 +08:00
|
|
|
|
# 直播间基本信息
|
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
## 获取用户对应的直播间状态
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
|
|
|
|
> http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:GET*
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
**url参数:**
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ---- | ----------- | ------ | ---- |
|
2020-06-08 22:44:46 +08:00
|
|
|
|
| mid | num | 目标用户UID | 必要 | |
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
2020-04-16 18:47:19 +08:00
|
|
|
|
根对象:
|
|
|
|
|
|
2020-04-08 16:20:28 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-400:请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-04-08 16:20:28 +08:00
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
2020-10-16 19:31:41 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------------- | ---- | ---------------- | ------------------------ |
|
|
|
|
|
| roomStatus | num | 直播间状态 | 0:无房间<br />1:有房间 |
|
|
|
|
|
| roundStatus | num | 轮播状态 | 0:未轮播<br />1:轮播 |
|
|
|
|
|
| liveStatus | num | 直播状态 | 0:未开播<br />1:直播中 |
|
|
|
|
|
| url | str | 直播间网页url | |
|
|
|
|
|
| title | str | 直播间标题 | |
|
|
|
|
|
| cover | str | 直播间封面 | |
|
|
|
|
|
| online | num | 直播间人气 | 值为上次直播刷新 |
|
|
|
|
|
| roomid | num | 直播间ID(短号) | |
|
|
|
|
|
| broadcast_type | num | 0 | |
|
|
|
|
|
| online_hidden | num | 0 | |
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
2020-04-16 18:47:19 +08:00
|
|
|
|
**示例:**
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
|
|
|
|
查询用户`UID=322892`的直播间信息
|
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2020-10-16 19:31:41 +08:00
|
|
|
|
curl -G 'http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
--data-urlencode 'mid=322892'
|
|
|
|
|
```
|
2020-04-08 16:20:28 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-04-08 16:20:28 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"roomStatus": 1,
|
|
|
|
|
"roundStatus": 0,
|
|
|
|
|
"liveStatus": 1,
|
|
|
|
|
"url": "https://live.bilibili.com/5441",
|
|
|
|
|
"title": "好久没当黑铁主播了",
|
|
|
|
|
"cover": "http://i0.hdslb.com/bfs/live/room_cover/833f7ff506bac17c06010e8834922993657505b2.jpg",
|
|
|
|
|
"online": 268602,
|
|
|
|
|
"roomid": 5441,
|
|
|
|
|
"broadcast_type": 0,
|
|
|
|
|
"online_hidden": 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
2020-10-11 18:04:32 +08:00
|
|
|
|
|
2020-10-16 19:31:41 +08:00
|
|
|
|
## 获取房间页初始化信息
|
2020-10-11 18:04:32 +08:00
|
|
|
|
|
2020-10-16 19:31:41 +08:00
|
|
|
|
> http://api.live.bilibili.com/room/v1/Room/room_init
|
2020-10-11 18:04:32 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:GET*
|
|
|
|
|
|
|
|
|
|
**url参数:**
|
|
|
|
|
|
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ---- | ----------- | ------ | ---- |
|
2020-10-16 19:31:41 +08:00
|
|
|
|
| id | num | 目标直播间号(短号) | 必要 | |
|
2020-10-11 18:04:32 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />60004:直播间不存在 |
|
|
|
|
|
| msg | str | 错误信息 | 默认为ok |
|
|
|
|
|
| message | str | 错误信息 | 默认为ok |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------------- | ---- | ------------- | ------------------------ |
|
|
|
|
|
| room_id | num | 直播间真实ID | |
|
2020-10-16 19:31:41 +08:00
|
|
|
|
| short_id | num | 直播间ID(短号) | |
|
|
|
|
|
| uid | num | 主播用户UID | |
|
|
|
|
|
| need_p2p | num | 是否p2p | |
|
|
|
|
|
| is_hidden | bool | 是否隐藏 | |
|
|
|
|
|
| is_locked | bool | 是否锁定 | |
|
|
|
|
|
| is_portrait | bool | 是否竖屏 | |
|
2020-10-11 18:07:00 +08:00
|
|
|
|
| live_status | num | 直播状态 | 0:未开播<br />1:直播中 |
|
2020-10-16 19:31:41 +08:00
|
|
|
|
| hidden_till | num | 隐藏时间戳 | |
|
|
|
|
|
| lock_till | num | 锁定时间戳 | |
|
|
|
|
|
| encrypted | bool | 是否加密 | |
|
|
|
|
|
| pwd_verified | bool | 加密房间是否通过密码验证 | `encrypted`=true时才有意义 |
|
2020-10-11 18:04:32 +08:00
|
|
|
|
| live_time | num | 开播时长 | |
|
|
|
|
|
| room_shield | num | 未知 | |
|
2020-10-16 19:31:41 +08:00
|
|
|
|
| is_sp | num | 是否为特殊直播间 | 0:普通直播间<br />1:付费直播间 |
|
|
|
|
|
| special_type | num | 特殊直播间标志 | 0:普通直播间<br />1:付费直播间<br />2:拜年祭直播间 |
|
2020-10-11 18:04:32 +08:00
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
|
|
|
|
查询直播间`ID=76`的直播间信息
|
|
|
|
|
|
|
|
|
|
```shell
|
2020-10-16 19:31:41 +08:00
|
|
|
|
curl -G 'http://api.live.bilibili.com/room/v1/Room/room_init' \
|
2020-10-11 18:04:32 +08:00
|
|
|
|
--data-urlencode 'id=76'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"msg":"ok",
|
|
|
|
|
"message":"ok",
|
|
|
|
|
"data":{
|
|
|
|
|
"room_id":14073662,
|
|
|
|
|
"short_id":76,
|
|
|
|
|
"uid":50333369,
|
|
|
|
|
"need_p2p":0,
|
|
|
|
|
"is_hidden":false,
|
|
|
|
|
"is_locked":false,
|
|
|
|
|
"is_portrait":false,
|
|
|
|
|
"live_status":1,
|
|
|
|
|
"hidden_till":0,
|
|
|
|
|
"lock_till":0,
|
|
|
|
|
"encrypted":false,
|
|
|
|
|
"pwd_verified":false,
|
|
|
|
|
"live_time":1602151186,
|
|
|
|
|
"room_shield":1,
|
|
|
|
|
"is_sp":0,
|
|
|
|
|
"special_type":0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-10-11 18:07:00 +08:00
|
|
|
|
</details>
|