bilibili-API-collect/live/info.md
2020-07-18 23:56:10 +08:00

70 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 直播间基本信息
## 获取用户对应的直播间状态
> http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld
*请求方式GET*
**url参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | ----------- | ------ | ---- |
| mid | num | 目标用户UID | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | --------------------------- |
| code | num | 返回值 | 0成功<br />-400请求错误 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 1 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------------- | ---- | ------------- | ------------------------ |
| 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 | |
**示例:**
查询用户`UID=322892`的直播间信息
```shell
curl -G 'http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld'\
--data-urlencode 'mid=322892'
```
```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
}
}
```