返回提交历史
Modified
README.md
+1
-0
Added
docs/article/card.md
+463
-0
Modified
docs/article/view.md
+2
-0
XFEstudio/bilibili-API-collect
feat: 专栏显示卡片信息
close #1247
8ed1756
代码差异
3 个文件
+466
-0
@@ -156,6 +156,7 @@ B站 API 采用 C/S 结构,大多数接口为 REST API 和 gRPC,少部分接
156
156
- [ ] [专栏](docs/article)
157
157
- [ ] [专栏内容](docs/article/view.md)
158
158
- [ ] [专栏分类](docs/article/category.md)
159
- [x] [卡片信息](docs/article/card.md)
159
160
- [X] [基本信息](docs/article/info.md)
160
161
- [X] [点赞 & 投币 & 收藏 & 分享](docs/article/action.md)
161
162
- [X] [文集基本信息](docs/article/articles.md)
@@ -0,0 +1,463 @@
1
# 卡片信息
2
3
## 获取专栏显示卡片信息
4
5
> https://api.bilibili.com/x/article/cards
6
7
*请求方法: GET*
8
9
鉴权方式: 请求头 `Referer` 在 `.bilibili.com` 下
10
11
**URL 参数:**
12
13
| 参数 | 类型 | 内容 | 必要性 | 备注 |
14
| ----- | ------ | ---- | ------ | ---- |
15
| ids | string | 被查询的 id 列表 | 不必要 | 以 `,` 分隔, 可填视频完整 AV/BV 号, 专栏 CV 号, 直播间长短 lv 号 (可能会合并同类项) |
16
| web_location | string | `333.1305` | 不必要 | |
17
| w_rid | string | WBI 签名 | 不必要 | 参见 [WBI 签名](../misc/sign/wbi.md) |
18
| wts | number | UNIX 秒级时间戳 | 不必要 | 参见 [WBI 签名](../misc/sign/wbi.md) |
19
20
**JSON 回复:**
21
22
根对象:
23
24
| 字段 | 类型 | 内容 | 备注 |
25
| ---- | ---- | ---- | ---- |
26
| code | number | 返回值 | 0: 成功 |
27
| data | object | 数据本体 | |
28
| message | string | 错误信息 | 成功时为 `0` |
29
| ttl | number | `1` | |
30
31
`data` 对象:
32
33
以请求时 `ids` 字段中每一项为键, 其内容对象为值的表, 注意可能会合并同类项
34
35
`data` 中代表视频的对象 (`avxxx` 或 `Bvxxxxxxxxxx`):
36
37
详细可参见 [视频基本信息] (../video/info.md)
38
39
| 字段 | 类型 | 内容 | 备注 |
40
| ---- | ---- | ---- | ---- |
41
| aid | number | | |
42
| bvid | string | | |
43
| cid | number | | |
44
| copyright | number | | |
45
| cover43 | string | | |
46
| ctime | number | | |
47
| desc | string | | |
48
| dimension | object | | |
49
| duration | number | | |
50
| dynamic | string | | |
51
| owner | object | | |
52
| pic | string | | |
53
| pubdate | number | | |
54
| rights | object | | |
55
| short_link_v2 | string | | |
56
| stat | object | | |
57
| state | number | | |
58
| tid | number | | |
59
| title | string | | |
60
| tname | string | | |
61
| videos | number | | |
62
| vt_switch | boolean | | |
63
64
`data` 中代表专栏的对象 (`cvxxx`):
65
66
详细可参见 [专栏内容](view.md)
67
68
| 字段 | 类型 | 内容 | 备注 |
69
| ---- | ---- | ---- | ---- |
70
| act_id | number | | |
71
| apply_time | string | | |
72
| attributes | number | | |
73
| authenMark | null | | |
74
| author | object | | |
75
| banner_url | string | | |
76
| categories | object[] | | |
77
| category | object | | |
78
| check_state | number | | |
79
| check_time | string | | |
80
| content_pic_list | null | | |
81
| cover_avid | number | | |
82
| ctime | number | | |
83
| dispute | null | | |
84
| dynamic | string | | |
85
| id | number | | |
86
| image_urls | string[] | | |
87
| is_like | boolean | | |
88
| list | object | | |
89
| media | object | | |
90
| mtime | number | | |
91
| origin_image_urls | string[] | | |
92
| origin_template_id | number | | |
93
| original | number | | |
94
| private_pub | number | | |
95
| publish_time | number | | |
96
| reprint | number | | |
97
| state | number | | |
98
| stats | object | | |
99
| summary | string | | |
100
| template_id | number | | |
101
| title | string | | |
102
| top_video_info | null | | |
103
| type | number | | |
104
| words | number | | |
105
106
`data` 中代表直播间的对象:
107
108
详细可参见 [直播间基本信息](../live/info.md)
109
110
| 字段 | 类型 | 内容 | 备注 |
111
| ---- | ---- | ---- | ---- |
112
| area_v2_name | string | 分区完整名称 | |
113
| cover | string | 直播封面 | |
114
| face | string | 主播头像 | |
115
| live_status | number | 直播状态 | |
116
| online | number | 在线人数 | |
117
| pendent_ru | string | | |
118
| pendent_ru_color | string | | |
119
| pendent_ru_pic | string | | |
120
| role | number | | |
121
| room_id | number | 直播间长 id | |
122
| title | string | 直播间标题 | |
123
| uid | number | 主播 UID (mid) | |
124
| uname | string | 主播用户名 | |
125
126
**示例:**
127
128
```shell
129
curl 'https://api.bilibili.com/x/article/cards?ids=av2,cv1,cv2,15111509,lv1,lv5440' \
130
--referer 'https://www.bilibili.com/'
131
```
132
133
<details>
134
<summary>查看响应示例:</summary>
135
136
```json
137
{
138
"code": 0,
139
"data": {
140
"av2": {
141
"aid": 2,
142
"bvid": "BV1xx411c7mD",
143
"cid": 62131,
144
"copyright": 2,
145
"cover43": "",
146
"ctime": 1497344798,
147
"desc": "www",
148
"dimension": {
149
"height": 360,
150
"rotate": 0,
151
"width": 480
152
},
153
"duration": 2055,
154
"dynamic": "",
155
"owner": {
156
"face": "https://i2.hdslb.com/bfs/face/ef0457addb24141e15dfac6fbf45293ccf1e32ab.jpg",
157
"mid": 2,
158
"name": "碧诗"
159
},
160
"pic": "http://static.hdslb.com/images/transparent.gif",
161
"pubdate": 1252458549,
162
"rights": {
163
"arc_pay": 0,
164
"autoplay": 1,
165
"bp": 0,
166
"download": 0,
167
"elec": 0,
168
"hd5": 0,
169
"is_cooperation": 0,
170
"movie": 0,
171
"no_background": 0,
172
"no_reprint": 0,
173
"pay": 0,
174
"pay_free_watch": 0,
175
"ugc_pay": 0,
176
"ugc_pay_preview": 0
177
},
178
"short_link_v2": "https://b23.tv/BV1xx411c7mD",
179
"stat": {
180
"aid": 2,
181
"coin": 38042,
182
"danmaku": 121342,
183
"dislike": 0,
184
"favorite": 107375,
185
"his_rank": 0,
186
"like": 261036,
187
"now_rank": 0,
188
"reply": 86021,
189
"share": 20052,
190
"view": 4983587,
191
"vt": 0,
192
"vv": 0
193
},
194
"state": 0,
195
"tid": 130,
196
"title": "字幕君交流场所",
197
"tname": "音乐综合",
198
"videos": 1,
199
"vt_switch": false
200
},
201
"cv1": {
202
"act_id": 0,
203
"apply_time": "",
204
"attributes": 24,
205
"authenMark": null,
206
"author": {
207
"face": "https://i1.hdslb.com/bfs/face/89fe260a17891fdadc3365a9698fee52796c7765.jpg",
208
"fans": 0,
209
"level": 0,
210
"mid": 91221505,
211
"name": "健行见远渐忘",
212
"nameplate": {
213
"condition": "2018.6.26-7.8某一天是年度大会员",
214
"image": "https://i2.hdslb.com/bfs/face/421179426c929dfeaed4117461c83f5d07ffb148.png",
215
"image_small": "https://i1.hdslb.com/bfs/face/682001c2e1c2ae887bdf2a0e18eef61180c48f84.png",
216
"level": "稀有勋章",
217
"name": "大会员2018年度勋章",
218
"nid": 74
219
},
220
"official_verify": {
221
"desc": "",
222
"type": -1
223
},
224
"pendant": {
225
"expire": 0,
226
"image": "https://i1.hdslb.com/bfs/face/7ae15f06f8c912435206a2578509d6bc77c12353.png",
227
"name": "作文鬼才",
228
"pid": 255
229
},
230
"vip": {
231
"avatar_subscript": 1,
232
"due_date": 0,
233
"label": {
234
"label_theme": "annual_vip",
235
"path": "http://i0.hdslb.com/bfs/vip/label_annual.png",
236
"text": "年度大会员"
237
},
238
"nickname_color": "#FB7299",
239
"status": 1,
240
"theme_type": 0,
241
"type": 2,
242
"vip_pay_type": 0
243
}
244
},
245
"banner_url": "https://i0.hdslb.com/bfs/article/b1e1029c08d8ad1bb06460d736839a7741dd7925.jpg",
246
"categories": [
247
{
248
"id": 3,
249
"name": "生活",
250
"parent_id": 0
251
},
252
{
253
"id": 15,
254
"name": "日常",
255
"parent_id": 3
256
}
257
],
258
"category": {
259
"id": 15,
260
"name": "日常",
261
"parent_id": 3
262
},
263
"check_state": 0,
264
"check_time": "",
265
"content_pic_list": null,
266
"cover_avid": 0,
267
"ctime": 1497973729,
268
"dispute": null,
269
"dynamic": "It's now or never !",
270
"id": 1,
271
"image_urls": [
272
"https://i0.hdslb.com/bfs/article/d2eedf1fd338bceca10099e2f7b33fa9017c859b.jpg"
273
],
274
"is_like": false,
275
"list": {
276
"apply_time": "",
277
"articles_count": 0,
278
"check_time": "",
279
"ctime": 1588601669,
280
"id": 253534,
281
"image_url": "",
282
"mid": 91221505,
283
"name": "静夜思",
284
"publish_time": 1625900652,
285
"read": 0,
286
"reason": "",
287
"state": 1,
288
"summary": "",
289
"update_time": 1625900518,
290
"words": 3059
291
},
292
"media": {
293
"area": "",
294
"cover": "",
295
"media_id": 0,
296
"score": 0,
297
"season_id": 0,
298
"spoiler": 0,
299
"title": "",
300
"type_id": 0,
301
"type_name": ""
302
},
303
"mtime": 1589209079,
304
"origin_image_urls": [
305
"https://i0.hdslb.com/bfs/article/b1e1029c08d8ad1bb06460d736839a7741dd7925.jpg"
306
],
307
"origin_template_id": 4,
308
"original": 0,
309
"private_pub": 0,
310
"publish_time": 1519913233,
311
"reprint": 0,
312
"state": 0,
313
"stats": {
314
"coin": 2545,
315
"dislike": 1,
316
"dynamic": 0,
317
"favorite": 17524,
318
"like": 32489,
319
"reply": 14399,
320
"share": 616,
321
"view": 1631442
322
},
323
"summary": "天空像是倾倒出的墨水,黑得静谧而深邃。黎明还远,光亮全无。夜不能寐。披衣,起床。茶香的弥漫,一盏灯的相伴。夜,你是我久别重逢的朋友,那一刹那的相见,带给了我久违的安思。如果不是梦魇的皮闹,我本不该投入",
324
"template_id": 4,
325
"title": "未知的光",
326
"top_video_info": null,
327
"type": 0,
328
"words": 1190
329
},
330
"cv2": {
331
"act_id": 0,
332
"apply_time": "",
333
"authenMark": null,
334
"author": {
335
"face": "http://i0.hdslb.com/bfs/face/ff6b51c3b339dae5f341d1693f52132ab11c86b6.jpg",
336
"fans": 0,
337
"level": 0,
338
"mid": 144900660,
339
"name": "专栏小天使",
340
"nameplate": {
341
"condition": "",
342
"image": "",
343
"image_small": "",
344
"level": "",
345
"name": "",
346
"nid": 0
347
},
348
"official_verify": {
349
"desc": "专栏小天使 官方账号",
350
"type": 0
351
},
352
"pendant": {
353
"expire": 0,
354
"image": "",
355
"name": "",
356
"pid": 0
357
},
358
"vip": {
359
"avatar_subscript": 0,
360
"due_date": 0,
361
"label": {
362
"label_theme": "",
363
"path": "",
364
"text": ""
365
},
366
"nickname_color": "",
367
"status": 0,
368
"theme_type": 0,
369
"type": 0,
370
"vip_pay_type": 0
371
}
372
},
373
"banner_url": "https://i0.hdslb.com/bfs/article/131b1d41b857d5308f5bff36591d117bddc48d96.jpg@90p.webp",
374
"categories": [
375
{
376
"id": 3,
377
"name": "生活",
378
"parent_id": 0
379
},
380
{
381
"id": 15,
382
"name": "日常",
383
"parent_id": 3
384
}
385
],
386
"category": {
387
"id": 15,
388
"name": "日常",
389
"parent_id": 3
390
},
391
"check_state": 0,
392
"check_time": "",
393
"content_pic_list": null,
394
"cover_avid": 0,
395
"ctime": 1497973871,
396
"dispute": null,
397
"id": 2,
398
"image_urls": [
399
"https://i0.hdslb.com/bfs/article/0a72422ce8e77d8512f010d93b1b7f9bc4e64e52.jpg"
400
],
401
"is_like": false,
402
"list": null,
403
"media": {
404
"area": "",
405
"cover": "",
406
"media_id": 0,
407
"score": 0,
408
"season_id": 0,
409
"spoiler": 0,
410
"title": "",
411
"type_id": 0,
412
"type_name": ""
413
},
414
"mtime": 1640696950,
415
"origin_image_urls": [
416
"https://i0.hdslb.com/bfs/article/131b1d41b857d5308f5bff36591d117bddc48d96.jpg"
417
],
418
"origin_template_id": 4,
419
"original": 0,
420
"private_pub": 0,
421
"publish_time": 1509517123,
422
"reprint": 1,
423
"state": 0,
424
"stats": {
425
"coin": 3590,
426
"dislike": 0,
427
"dynamic": 0,
428
"favorite": 5614,
429
"like": 16956,
430
"reply": 1944,
431
"share": 371,
432
"view": 1184187
433
},
434
"summary": "欢迎各位使用Bilibili专栏,为了保证Bilibili专栏的内容质量,维护专栏的内容生态,让创作者和读者都拥有良好的使用体验和阅读体验,请各位谨遵以下规范条例:\n\n严令禁止条例\nbilibili严",
435
"template_id": 4,
436
"title": "专栏行为准则 ",
437
"top_video_info": null,
438
"type": 0,
439
"words": 3711
440
},
441
"lv5440": {
442
"area_v2_name": "历史·人文·综合",
443
"cover": "https://i0.hdslb.com/bfs/live/9fe50921ab9b49e80dcb398f65135191d1b8252c.jpg",
444
"face": "https://i0.hdslb.com/bfs/face/8f6a614a48a3813d90da7a11894ae56a59396fcd.jpg",
445
"live_status": 2,
446
"online": 0,
447
"pendent_ru": "",
448
"pendent_ru_color": "",
449
"pendent_ru_pic": "",
450
"role": 0,
451
"room_id": 5440,
452
"title": "一场穿越20年的直播|梦回千禧文学",
453
"uid": 9617619,
454
"uname": "哔哩哔哩直播"
455
}
456
},
457
"message": "0",
458
"ttl": 1
459
}
460
```
461
</details>
462
463
<!-- Generated by json-apidoc-gen @ 2025-04-26T08:24:57.605652577Z -->
@@ -6,6 +6,8 @@
6
6
7
7
*请求方法: GET*
8
8
9
鉴权方式: 请求头 `User-Agent`
10
9
11
**URL 参数:**
10
12
11
13
| 参数 | 类型 | 内容 | 必要性 | 备注 |