|
| 1 | +# 直播流水 |
| 2 | + |
| 3 | +## 获取所有礼物列表 |
| 4 | + |
| 5 | +> https://api.live.bilibili.com/gift/v1/master/getGiftTypes |
| 6 | +
|
| 7 | +*请求方式:GET* |
| 8 | + |
| 9 | +认证方式:Cookie(SESSDATA) |
| 10 | + |
| 11 | +**json回复:** |
| 12 | + |
| 13 | +根对象: |
| 14 | + |
| 15 | +| 字段 | 类型 | 内容 | 备注 | |
| 16 | +| ------- | ----- | -------- | -------------- | |
| 17 | +| code | num | 返回值 | 0:成功 | |
| 18 | +| msg | str | 错误信息 | 默认为 success | |
| 19 | +| message | str | 错误信息 | 默认为 success | |
| 20 | +| data | array | 礼物列表 | | |
| 21 | + |
| 22 | +`data` 数组: |
| 23 | + |
| 24 | +| 字段 | 类型 | 内容 | 备注 | |
| 25 | +| --------- | ---- | -------- | ------------------------------------------------------------------------------ | |
| 26 | +| gift_id | num | 礼物 id | | |
| 27 | +| gift_name | str | 礼物名称 | | |
| 28 | +| price | num | 瓜子数量 | 电池礼物为金瓜子数量,银瓜子礼物为银瓜子数量。 (金瓜子数量 / 100 = 电池数量) | |
| 29 | + |
| 30 | +*注:特殊礼物如舰长、提督、总督等没有 `price` 字段* |
| 31 | + |
| 32 | +<details> |
| 33 | +<summary>查看响应示例:</summary> |
| 34 | + |
| 35 | +```jsonc |
| 36 | + { |
| 37 | + "code": 0, |
| 38 | + "msg": "success", |
| 39 | + "message": "success", |
| 40 | + "data": [ |
| 41 | + { |
| 42 | + "gift_id": 10001, |
| 43 | + "gift_name": "总督" |
| 44 | + }, |
| 45 | + { |
| 46 | + "gift_id": 10002, |
| 47 | + "gift_name": "提督" |
| 48 | + }, |
| 49 | + { |
| 50 | + "gift_id": 10003, |
| 51 | + "gift_name": "舰长" |
| 52 | + }, |
| 53 | + { |
| 54 | + "gift_id": 12000, |
| 55 | + "gift_name": "醒目留言" |
| 56 | + }, |
| 57 | + { |
| 58 | + "gift_id": 1, |
| 59 | + "price": 100, |
| 60 | + "gift_name": "辣条" |
| 61 | + }, |
| 62 | + { |
| 63 | + "gift_id": 3, |
| 64 | + "price": 9900, |
| 65 | + "gift_name": "B坷垃" |
| 66 | + }, |
| 67 | + { |
| 68 | + "gift_id": 6, |
| 69 | + "price": 1000, |
| 70 | + "gift_name": "亿圆" |
| 71 | + }, |
| 72 | + { |
| 73 | + "gift_id": 30426, |
| 74 | + "price": 0, |
| 75 | + "gift_name": "BLS能量石" |
| 76 | + }, |
| 77 | + { |
| 78 | + "gift_id": 30706, |
| 79 | + "price": 1000, |
| 80 | + "gift_name": "生日快乐" |
| 81 | + }, |
| 82 | + { |
| 83 | + "gift_id": 30707, |
| 84 | + "price": 5200, |
| 85 | + "gift_name": "生日蛋糕" |
| 86 | + }, |
| 87 | + { |
| 88 | + "gift_id": 30708, |
| 89 | + "price": 52000, |
| 90 | + "gift_name": "生日王冠" |
| 91 | + }, |
| 92 | + { |
| 93 | + "gift_id": 31049, |
| 94 | + "price": 6600, |
| 95 | + "gift_name": "干杯" |
| 96 | + }, |
| 97 | + { |
| 98 | + "gift_id": 31116, |
| 99 | + "price": 6600, |
| 100 | + "gift_name": "干杯" |
| 101 | + }, |
| 102 | + { |
| 103 | + "gift_id": 31251, |
| 104 | + "price": 6600, |
| 105 | + "gift_name": "干杯" |
| 106 | + }, |
| 107 | + { |
| 108 | + "gift_id": 31531, |
| 109 | + "price": 0, |
| 110 | + "gift_name": "PK票" |
| 111 | + }, |
| 112 | + { |
| 113 | + "gift_id": 31588, |
| 114 | + "price": 19900, |
| 115 | + "gift_name": "星河入梦" |
| 116 | + }, |
| 117 | + { |
| 118 | + "gift_id": 31589, |
| 119 | + "price": 131400, |
| 120 | + "gift_name": "我星永恒" |
| 121 | + }, |
| 122 | + { |
| 123 | + "gift_id": 32276, |
| 124 | + "price": 0, |
| 125 | + "gift_name": "粉丝团灯牌" |
| 126 | + }, |
| 127 | + // ... |
| 128 | + ] |
| 129 | + } |
| 130 | +``` |
| 131 | + |
| 132 | +</details> |
| 133 | + |
| 134 | +## 获取流水 |
| 135 | + |
| 136 | +> https://api.live.bilibili.com/xlive/revenue/v1/giftStream/getReceivedGiftStreamNextList |
| 137 | +
|
| 138 | +*请求方式:GET* |
| 139 | + |
| 140 | +认证方式:Cookie(SESSDATA) |
| 141 | + |
| 142 | +请求参数: |
| 143 | + |
| 144 | +| 参数名 | 类型 | 内容 | 必要性 | 备注 | |
| 145 | +| ---------- | ------------- | ----------------------- | ---------- | -------------------------------------- | |
| 146 | +| limit | num | 一页有多少条目 | 必要 | | |
| 147 | +| coin_type | num | 礼物类型 | 必要 | 0 为所有,1 为电池礼物,2 为银瓜子礼物 | |
| 148 | +| begin_time | date / string | 流水的日期 | 必要 | 格式为 yyyy-MM-dd | |
| 149 | +| uname | string | 筛选的用户名 | 非必要 | | |
| 150 | +| last_id | num | 上一页页末的礼物列表 id | 翻页时必要 | 见下方 `list` 数组说明 | |
| 151 | +| gift_id | num | 筛选的礼物 id | | | |
| 152 | + |
| 153 | +请求示例:`https://api.live.bilibili.com/xlive/revenue/v1/giftStream/getReceivedGiftStreamNextList?limit=20&coin_type=0&begin_time=2023-01-01` |
| 154 | + |
| 155 | +请求示例(翻页时):`https://api.live.bilibili.com/xlive/revenue/v1/giftStream/getReceivedGiftStreamNextList?last_id=13834493&limit=20&coin_type=0&begin_time=2023-01-01` |
| 156 | + |
| 157 | +**json 回复:** |
| 158 | + |
| 159 | +根对象: |
| 160 | + |
| 161 | +| 字段 | 类型 | 内容 | 备注 | |
| 162 | +| ------- | ------ | -------- | -------------- | |
| 163 | +| code | num | 返回值 | 0:成功 | |
| 164 | +| msg | str | 错误信息 | 默认为 success | |
| 165 | +| message | str | 错误信息 | 默认为 success | |
| 166 | +| data | object | 流水 | | |
| 167 | + |
| 168 | +`data` 对象: |
| 169 | + |
| 170 | +| 字段 | 类型 | 内容 | 备注 | |
| 171 | +| ------------- | ----- | -------------- | -------------- | |
| 172 | +| has_more | num | 是否由下一页 | 1 为是,0 为否 | |
| 173 | +| total_hamster | num | 总的金仓鼠收益 | | |
| 174 | +| list | array | 礼物列表 | | |
| 175 | + |
| 176 | +`list` 数组: |
| 177 | + |
| 178 | +| 字段 | 类型 | 内容 | 备注 | |
| 179 | +| ------------------ | ---------- | ------------------------------------- | -------------------------- | |
| 180 | +| uid | num | 送礼用户的 uid | | |
| 181 | +| uname | str | 用户名 | | |
| 182 | +| time | date / str | 送礼时间 | | |
| 183 | +| gift_id | num | 礼物 id | | |
| 184 | +| gift_name | str | 礼物名字 | | |
| 185 | +| gift_img | str | 礼物图片链接 | | |
| 186 | +| gift_num | num | 礼物数量 | | |
| 187 | +| hamster | num | 金仓鼠数量 | | |
| 188 | +| gold | num | 礼物价值(金瓜子) | | |
| 189 | +| silver | num | 礼物价值(银瓜子) | | |
| 190 | +| ios_hamster | num | 由 iOS 端送出的礼物所收到的金仓鼠 | | |
| 191 | +| normal_hamster | num | 一般情况下收到的金仓鼠 | | |
| 192 | +| ios_gold | num | 由 iOS 端送出的礼物所收到的金瓜子数量 | | |
| 193 | +| normal_gold | num | 一般情况下收到的金瓜子数量 | | |
| 194 | +| is_hybrid | bool | 是否混合 | 作用不明 | |
| 195 | +| id | num | 此项 id | 用于翻页 | |
| 196 | +| is_open_platfrom | num | 是否开放平台 | 作用不明 | |
| 197 | +| open_platfrom_rate | num | 开放平台比率 (?) | 作用不明 | |
| 198 | +| receive_title | str | | 作用不明 ,一般为 `"主播"` | |
| 199 | +| room_id | num | 送礼房间id | 如果礼物为上舰,此项为 `0` | |
| 200 | + |
| 201 | +<details> |
| 202 | +<summary>查看响应示例:</summary> |
| 203 | + |
| 204 | +```json |
| 205 | +{ |
| 206 | + "code": 0, |
| 207 | + "message": "0", |
| 208 | + "ttl": 1, |
| 209 | + "data": { |
| 210 | + "list": [ |
| 211 | + { |
| 212 | + "uid": 0000000000, |
| 213 | + "uname": "XXXXXXX", |
| 214 | + "time": "2023-01-01 00:00:00", |
| 215 | + "gift_id": 31216, |
| 216 | + "gift_name": "i了i了", |
| 217 | + "gift_img": "https://s1.hdslb.com/bfs/live/1157a445487b39c0b7368d91b22290c60fa665b2.png", |
| 218 | + "gift_num": 1, |
| 219 | + "hamster": 50, |
| 220 | + "gold": 100, |
| 221 | + "silver": 0, |
| 222 | + "ios_hamster": 0, |
| 223 | + "normal_hamster": 50, |
| 224 | + "ios_gold": 0, |
| 225 | + "normal_gold": 100, |
| 226 | + "is_hybrid": false, |
| 227 | + "id": 14269551, |
| 228 | + "is_open_platfrom": 0, |
| 229 | + "open_platfrom_rate": 0, |
| 230 | + "receive_title": "主播", |
| 231 | + "room_id": 000001 |
| 232 | + }, |
| 233 | + { |
| 234 | + "uid": 0000000000, |
| 235 | + "uname": "XXXXXXX", |
| 236 | + "time": "2023-01-01 00:00:00", |
| 237 | + "gift_id": 10003, |
| 238 | + "gift_name": "舰长", |
| 239 | + "gift_img": "https://i0.hdslb.com/bfs/live/f1be2a2d5b227ce72641de1ad64bcc7f9e4111c3.png", |
| 240 | + "gift_num": 1, |
| 241 | + "hamster": 69000, |
| 242 | + "gold": 138000, |
| 243 | + "silver": 0, |
| 244 | + "ios_hamster": 0, |
| 245 | + "normal_hamster": 69000, |
| 246 | + "ios_gold": 0, |
| 247 | + "normal_gold": 138000, |
| 248 | + "is_hybrid": false, |
| 249 | + "id": 14258453, |
| 250 | + "is_open_platfrom": 0, |
| 251 | + "open_platfrom_rate": 0, |
| 252 | + "receive_title": "主播", |
| 253 | + "room_id": 000000 |
| 254 | + }, |
| 255 | + { |
| 256 | + "uid": 0000000000, |
| 257 | + "uname": "XXXXXXX", |
| 258 | + "time": "2023-01-01 00:00:00", |
| 259 | + "gift_id": 31036, |
| 260 | + "gift_name": "小花花", |
| 261 | + "gift_img": "https://s1.hdslb.com/bfs/live/8b40d0470890e7d573995383af8a8ae074d485d9.png", |
| 262 | + "gift_num": 1, |
| 263 | + "hamster": 50, |
| 264 | + "gold": 100, |
| 265 | + "silver": 0, |
| 266 | + "ios_hamster": 0, |
| 267 | + "normal_hamster": 50, |
| 268 | + "ios_gold": 0, |
| 269 | + "normal_gold": 100, |
| 270 | + "is_hybrid": false, |
| 271 | + "id": 14243903, |
| 272 | + "is_open_platfrom": 0, |
| 273 | + "open_platfrom_rate": 0, |
| 274 | + "receive_title": "主播", |
| 275 | + "room_id": 000001 |
| 276 | + }, |
| 277 | + { |
| 278 | + "uid": 0000000000, |
| 279 | + "uname": "XXXXXXX", |
| 280 | + "time": "2023-01-01 00:00:00", |
| 281 | + "gift_id": 30047, |
| 282 | + "gift_name": "友谊的小船", |
| 283 | + "gift_img": "https://s1.hdslb.com/bfs/live/b33c94c51b669bd88f811ecf5f4e34a1db22a648.png", |
| 284 | + "gift_num": 1, |
| 285 | + "hamster": 2450, |
| 286 | + "gold": 4900, |
| 287 | + "silver": 0, |
| 288 | + "ios_hamster": 0, |
| 289 | + "normal_hamster": 2450, |
| 290 | + "ios_gold": 0, |
| 291 | + "normal_gold": 4900, |
| 292 | + "is_hybrid": false, |
| 293 | + "id": 14242683, |
| 294 | + "is_open_platfrom": 0, |
| 295 | + "open_platfrom_rate": 0, |
| 296 | + "receive_title": "主播", |
| 297 | + "room_id": 000001 |
| 298 | + }, |
| 299 | + { |
| 300 | + "uid": 0000000000, |
| 301 | + "uname": "XXXXXXX", |
| 302 | + "time": "2023-01-01 00:00:00", |
| 303 | + "gift_id": 31738, |
| 304 | + "gift_name": "粉丝团灯牌", |
| 305 | + "gift_img": "https://s1.hdslb.com/bfs/live/cbed3bb0a894369b49ceaf0b5337b4491b75ac42.png", |
| 306 | + "gift_num": 1, |
| 307 | + "hamster": 0, |
| 308 | + "gold": 1000, |
| 309 | + "silver": 1000, |
| 310 | + "ios_hamster": 0, |
| 311 | + "normal_hamster": 0, |
| 312 | + "ios_gold": 0, |
| 313 | + "normal_gold": 0, |
| 314 | + "is_hybrid": false, |
| 315 | + "id": 14237376, |
| 316 | + "is_open_platfrom": 0, |
| 317 | + "open_platfrom_rate": 0, |
| 318 | + "receive_title": "主播", |
| 319 | + "room_id": 000001 |
| 320 | + } |
| 321 | + ], |
| 322 | + "has_more": 1, |
| 323 | + "total_hamster": 122050 |
| 324 | + } |
| 325 | +} |
| 326 | +``` |
| 327 | + |
| 328 | +</details> |
0 commit comments