bilibili-API-collect/B站API.txt
2020-07-14 18:44:44 +08:00

698 lines
15 KiB
Plaintext
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.

#视频短网址
b23.tv/ avID/ssID/epID/smID
跳转至
www.bilibili.com/video/ avID
www.bilibili.com/bangumi/play/ ssID/epID
www.nicovideo.jp/watch/ smID
#跳转至主站
acg.tv
bilibili.cn
bilibili.tv
## at我的明细
需要登录(SESSDATA)
访问则消去未读
api.bilibili.com/x/msgfeed/at
*方式GET*
## 系统通知明细
需要登录(SESSDATA)
访问则消去未读
message.bilibili.com/api/notify/query.sysnotify.list.do
*方式GET*
在线用户
api.bilibili.com/x/web-interface/online
方式:GET
json回复
{
"code":0,
"message":"0",
"ttl":1,
"data":{
"region_count":{
"1":6516,动画
"11":7,电视剧
"119":499,鬼畜
"129":1472,舞蹈
"13":338,番剧
"138":7908,搞笑
"155":2270,时尚
"160":56943,生活
"165":386,广告
"167":439,国创
"17":12698,单机游戏
"177":957,纪录片
"181":12761,影视
"188":1830,数码
"23":2,电影
"3":10583,音乐
"36":10074,科技
"4":48084,游戏
"5":10106,娱乐
"75":3918,动物圈
"76":3492 美食圈
},
"all_count":(num:),
"web_online":(num:在线人数),
"play_online":12561016
}
}
默认搜索
api.bilibili.com/x/web-interface/search/default
方式:GET
json回复
{
"code":0,
"message":"0",
"ttl":1,
"data":{
"seid":"12670784065342714945",
"id":9185549926650114417,
"type":0,
"show_name":(str:展示名),
"name":"",
"goto_type":1,
"goto_value":(str:内容ID),
"url":(str:内容网址)
}
}
主页浮标
api.bilibili.com/x/web-interface/index/icon
方式:GET
json回复
{
"code":0,
"message":"0",
"ttl":1,
"data":{
"id":(num:编号),
"title":(str:名称),
"links":[(str:链接)],
"icon":(str:图标链接),
"weight":20
}
}
-------------------------------------------------
#用户相关
获取用户空间设置
space.bilibili.com/ajax/settings/getSettings?mid=1
方式:GET
{
"status":true,
"data":{
"privacy":{
"bangumi":1,
"bbq":1,
"channel":1,
"coins_video":0,
"comic":1,
"dress_up":1,
"fav_video":1,
"groups":1,
"likes_video":0,
"played_game":1,
"tags":0,
"user_info":1
},
"index_order":[{"id":1,"name":"\u6211\u7684\u7a3f\u4ef6"},
{"id":8,"name":"\u6211\u7684\u4e13\u680f"},
{"id":7,"name":"\u6211\u7684\u9891\u9053"},
{"id":2,"name":"\u6211\u7684\u6536\u85cf\u5939"},
{"id":3,"name":"\u8ba2\u9605\u756a\u5267"},
{"id":4,"name":"\u8ba2\u9605\u6807\u7b7e"},
{"id":5,"name":"\u6700\u8fd1\u6295\u5e01\u7684\u89c6\u9891"},
{"id":6,"name":"\u6211\u7684\u5708\u5b50"},
{"id":9,"name":"\u6211\u7684\u76f8\u7c3f"},
{"id":21,"name":"\u516c\u544a"},
{"id":22,"name":"\u76f4\u64ad\u95f4"},
{"id":23,"name":"\u4e2a\u4eba\u8d44\u6599"},
{"id":24,"name":"\u5b98\u65b9\u6d3b\u52a8"},
{"id":25,"name":"\u6700\u8fd1\u73a9\u8fc7\u7684\u6e38\u620f"}
],
"theme":"default",
"theme_preview_img_path":"",
"toutu":{
"sid":1,
"expire":2844296881,
"s_img":"bfs\/space\/768cc4fd97618cf589d23c2711a1d1a729f42235.png",
"l_img":"bfs\/space\/cb1c3ef50e22b6096fde67febe863494caefebad.png",
"android_img":"",
"iphone_img":"",
"ipad_img":"",
"thumbnail_img":"",
"platform":0
}
}
}
用户收藏夹预览
api.bilibili.com/medialist/gateway/base/created?up_mid=&pn=&ps=
方式:GET
请求参数
up_mid=(用户UID)
pn=(页码)
ps=(每页项数)
-------------------------------------------------
#视频相关
更改弹幕池 (需要登录)
api.bilibili.com/x/v2/dm/edit/pool
方式:POST
参数:
参数名 type oid pool dmids csrf
内容 视频CID 弹幕池 0普通 1字幕 弹幕ID CSRF Token位于cookie
必要性 必要 必要 必要
json回复
{"code":0,"message":"0","ttl":1}
操作弹幕 (需要登录)
api.bilibili.com/x/v2/dm/edit/state
方式:POST
操作代码:
1删除
2保护
3取消保护
参数:
参数名 type oid state dmids csrf
内容 视频CID 操作代码 弹幕ID CSRF Token位于cookie
必要性 必要 必要 必要
-------------------------------------------------
#创作中心相关
电磁力状态 (需要登录)
api.bilibili.com/studio/up-rating/rating/status
方式:GET
json回复
{
"code":0,
"message":"0",
"ttl":1,
"data":{
"status":1,
"level":(num:电磁力等级),
"color":(str:文字颜色)
}
}
最新回复 (需要登录)
member.bilibili.com/x/web/replies
方式:GET
最新弹幕 (需要登录)
member.bilibili.com/x/web/danmu/recent?pn=1&ps=50
方式:GET
全部稿件 (需要登录)
member.bilibili.com/x/web/archives?status=is_pubing%2Cpubed%2Cnot_pubed&pn=1&ps=10&coop=1&interactive=1
方式:GET
全部专栏 (需要登录)
api.bilibili.com/x/article/creative/article/list?group=0&sort=&pn=1
方式:GET
全部申诉 (需要登录)
member.bilibili.com/x/web/appeal/list?ps=10&state=all&pn=1
方式:GET
收到的字幕 (需要登录)
api.bilibili.com/x/v2/dm/subtitle/search/assist?type=1&status=0&page=1&size=10
方式:GET
视频播放来源 (需要登录)
member.bilibili.com/x/web/data/playsource
方式:GET
视频游客分析 (需要登录)
member.bilibili.com/x/web/data/base
方式:GET
游客内容倾向 (需要登录)
member.bilibili.com/x/web/data/trend
方式:GET
粉丝变化历史 (需要登录)
member.bilibili.com/x/web/data/action
方式:GET
最新粉丝动态 (需要登录)
member.bilibili.com/x/web/data/fan
方式:GET
-------------------------------------------------
#收藏夹与历史记录相关
收藏夹明细
api.bilibili.com/medialist/gateway/base/spaceDetail?media_id=&pn=&ps=
方式:GET
-------------------------------------------------
#TAG相关
TAG详细信息
api.bilibili.com/x/web-interface/channel/detail?channel_id=(TAGID)
方式:GET
-------------------------------------------------
#番剧相关
最新更新
bangumi.bilibili.com/api/timeline_v2_global
番剧状态数
api.bilibili.com/pgc/web/season/stat?season_id=
番剧精选短评
api.bilibili.com/pgc/review/relate?media_id=
-------------------------------------------------
#音频相关
歌单简介
www.bilibili.com/audio/music-service-c/web/menu/info?sid=10624
歌单明细
www.bilibili.com/audio/music-service-c/web/song/of-menu?sid=10624&pn=1&ps=100
歌曲简介
www.bilibili.com/audio/music-service-c/web/song/info?sid=1294480
歌曲TAG
www.bilibili.com/audio/music-service-c/web/tag/song?sid=1294480
歌曲制作组
www.bilibili.com/audio/music-service-c/web/member/song?sid=1294480
歌曲相似推荐
www.bilibili.com/audio/music-service-c/web/song/similar?sid=1294480
音乐用户简介
www.bilibili.com/audio/music-service-c/web/user/info?uid=
音乐用户状态数
www.bilibili.com/audio/music-service-c/web/stat/user?uid=8775742
音乐获取地址
www.bilibili.com/audio/music-service-c/web/url?sid=1294480
音频榜单
www.bilibili.com/audio/music-service-c/web/home/list-rank?pn=1&ps=10
音频榜单明细
www.bilibili.com/audio/music-service-c/web/home/hit-rank
{
"code":0,
"msg":"success",
"data":[
#新歌榜歌单
{
"menuId":10624,
"uid":32708543,
"uname":"大家的音乐姬",
"title":"每日新曲推荐每日11:00更新",
"cover":"http://i0.hdslb.com/bfs/music/a32c1ed4f6ec3f74f8240f4486a750dda3a509e5.jpg",
"intro":"每天11:00更新为你推送最新音乐",
"type":2,
"off":0,
"ctime":1501209433,
"curtime":1582165425,
"statistic":{
"sid":10624,
"play":1969454,
"collect":17525,
"comment":973,
"share":453
},
"snum":20,
"attr":0,
"isDefault":0,
"collectionId":0,
"audios":[
{
"id":817499,
"title":"【ゆう十】好想爱这个世界啊",
"duration":264
},
#向下扩展
]
},
#热歌榜歌单
{
"menuId":10627,
"uid":32708543,
"uname":"大家的音乐姬",
"title":"热歌榜每日11:00更新",
"cover":"http://i0.hdslb.com/bfs/music/bc735b32ab123f7ddc602b9194defae2cd66062f.jpg",
"intro":"每日上午11:00更新精选三日内热门投稿作品。",
"type":2,
"off":0,
"ctime":1501211353,
"curtime":1582165425,
"statistic":{
"sid":10627,
"play":1536399,
"collect":8661,
"comment":323,
"share":145
},
"snum":19,
"attr":0,
"isDefault":0,
"collectionId":0,
"audios":[
{
"id":829642,
"title":"曙光",
"duration":287
},
#向下扩展
]
},
#原创榜歌单
{
"menuId":10628,
"uid":32708543,
"uname":"大家的音乐姬",
"title":"原创榜每日11:00更新",
"cover":"http://i0.hdslb.com/bfs/music/58782504cefb307878d12422fd365ed7f971fad1.jpg",
"intro":"每日上午11:00更新精选三日内原创投稿音乐。",
"type":2,
"off":0,
"ctime":1501211627,
"curtime":1582165425,
"statistic":{
"sid":10628,
"play":262030,
"collect":1962,
"comment":260,
"share":71
},
"snum":20,
"attr":0,
"isDefault":0,
"collectionId":0,
"audios":[
{
"id":829642,
"title":"曙光",
"duration":287
},
#向下扩展
]
}
]
}
-------------------------------------------------
#专栏相关
文集基本信息
api.bilibili.com/x/article/list/web/articles?id=
点赞专栏 (需要登录)
api.bilibili.com/x/article/like
方式:POST
参数:
参数名 aid type csrf
内容 专栏cvID 1点赞 2取消赞 CSRF Token位于cookie
必要性 必要 必要 必要
{
"code":0,
"message":"0",
"ttl":1
}
投币专栏 (需要登录)
api.bilibili.com/x/web-interface/coin/add
方式:POST
参数:
参数名 aid multiply upid avtype csrf
内容 专栏cvID 投币数量 上限为2 作者UID 必须为2 CSRF Token位于cookie
必要性 必要 必要 必要 必要 必要
json回复
{
"code":0,
"message":"0",
"ttl":1,
"data":{
"like":false
}
}
收藏专栏 (需要登录)
api.bilibili.com/x/article/favorites/add
方式:POST
参数:
参数名 aid csrf
内容 专栏cvID CSRF Token位于cookie
必要性 必要 必要
json回复
{
"code":0,
"message":"0",
"ttl":1
}
-------------------------------------------------
#动态相关
未读动态数 (需要登录)
api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_num?rsp_type=1&uid=293793435&update_num_dy_id=360462659397144349&type_list=8,512
动态内容 (仅自己可见时需要登录)
api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/get_dynamic_detail
方式:GET
参数名 dynamic_id
内容 动态ID
必要性 必要
发表文字动态 (需要登录)
api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create
方式:POST
参数:
type=必须为4 必要
content=文字内容 必要
extension=%7B%22emoji_type%22%3A1%7D 必要
at_uids=需要at的uid 非必要
ctrl=%5B%5D 非必要
{
"code":(num:0成功 -6账号未登录 500103无内容),
"msg":(str:错误信息 默认为空),
"message":(str:错误信息 默认为空),
"data":{
"result":0,
"errmsg":";Create dynamic 362109538834657119 OK, result:1; Push create kafka:0; Register comment result:0; Add outbox result:1; Send at_msg result:0",
"dynamic_id":(num:动态ID),
"create_result":1,
"dynamic_id_str":(str:动态ID),
"_gt_":0
}
}
发表相簿动态 (需要登录)
api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create_draw
方式:POST
biz=必须为3
category=必须为3
type=必须为0
pictures=%5B%7B%22img_src%22%3A%22http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Falbum%2Fd0431e47263b56d1d0f6b59af0e5fedaefb5de74.jpg%22%2C%22img_width%22%3A695%2C%22img_height%22%3A1000%2C%22img_size%22%3A686.537109375%7D%2C%7B%22img_src%22%3A%22http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Falbum%2F918db3bcacef6793c3ad2fe84dd804750c2052f5.png%22%2C%22img_width%22%3A1000%2C%22img_height%22%3A688%2C%22img_size%22%3A516.90625%7D%5D
title=
tags=
description=文字内容
content=文字内容
setting=%7B%22copy_forbidden%22%3A0%2C%22cachedTime%22%3A0%7D
from=必须为create.dynamic.web
extension=%7B%22emoji_type%22%3A1%7D
at_uids=需要at的uid 非必要
at_control=%5B%5D
csrf_token=5e8178eeedd85fdae78a47cabad198a7
{
"code":0,
"msg":"",
"message":"",
"data":{
"doc_id":"59718150",
"dynamic_id":362117390040148339,
"dynamic_id_str":"362117390040148339",
"_gt_":0
}
}
发起投票
api.vc.bilibili.com/vote_svr/v1/vote_svr/create_vote
发表定时动态 (需要登录)
api.vc.bilibili.com/dynamic_draft/v1/dynamic_draft/add_draft
方式:POST
type=4
publish_time=1583159280
request=%7B%22dynamic_id%22%3A0%2C%22type%22%3A4%2C%22rid%22%3A0%2C%22content%22%3A%22%E6%B5%8B%E8%AF%95%22%2C%22extension%22%3A%22%7B%5C%22emoji_type%5C%22%3A1%7D%22%2C%22at_uids%22%3A%22%22%2C%22ctrl%22%3A%22%5B%5D%22%7D&csrf_token=5e8178eeedd85fdae78a47cabad198a7
{
"code":0,
"msg":"",
"message":"",
"data":{
"errmsg":"add draft succ.",
"draft_id":52393,
"_gt_":0
}
}
删除定时动态 (需要登录)
api.vc.bilibili.com/dynamic_draft/v1/dynamic_draft/rm_draft
转载动态 (需要登录)
api.vc.bilibili.com/dynamic_repost/v1/dynamic_repost/repost
方式:POST
uid=293793435
dynamic_id=362041815795291620
content=%E5%B9%B2%E5%BE%97%E6%BC%82%E4%BA%AE%EF%BC%81
extension=%7B%22emoji_type%22%3A1%7D
at_uids=
ctrl=%5B%5D
csrf_token=5e8178eeedd85fdae78a47cabad198a7
{
"code":0,
"msg":"",
"message":"",
"data":{
"result":0,
"errmsg":"符合条件,允许发布",
"_gt_":0
}
}
删除动态 (需要登录)
api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic
方式:POST
参数:
参数名 dynamic_id
内容 动态ID
必要性 必要
json回复
{
"code":(num:0成功 -6账号未登录 500003参数错误 500404不能重复删除 500405动态ID不合法),
"msg":(str:错误信息 默认为空),
"message":(str:错误信息 默认为空),
"data":{
"_gt_":0
}
}
点赞动态 (需要登录)
api.vc.bilibili.com/dynamic_like/v1/dynamic_like/thumb
方式:POST
uid=293793435
dynamic_id=362113743614996443
up=1
csrf_token=5e8178eeedd85fdae78a47cabad198a7
{
"code":0,
"msg":"",
"message":"",
"data":{
"_gt_":0
}
}
置顶动态 (需要登录)
api.vc.bilibili.com/dynamic_mix/v1/dynamic_mix/space_top_set
方式:GET
参数:
参数名 dynamic_id
内容 动态ID
必要性 必要
无返回
取消置顶动态 (需要登录)
api.vc.bilibili.com/dynamic_mix/v1/dynamic_mix/space_top_rm
方式:GET
参数:
参数名 dynamic_id
内容 动态ID
必要性 必要
无返回
搜索用户昵称
api.vc.bilibili.com/dynamic_repost/v1/dynamic_repost/name_search?keyword=
昵称转换UID
api.vc.bilibili.com/dynamic_mix/v1/dynamic_mix/name_to_uid?names=%E5%B0%8F%E6%9E%97%E5%AE%B6%E7%9A%84%E5%9E%83%E5%9C%BE%E7%8E%8BR&teenagers_mode=0
-------------------------------------------------
#直播相关
最热直播间
api.live.bilibili.com/room/v1/RoomRecommend/biliIndexRecList
小图标
https://www.bilibili.com/index/index-icon.json
上传稿件封面
POST
http://member.bilibili.com/x/vu/web/cover/up
data
cover:
csrf:
活动
GET
https://member.bilibili.com/x/app/h5/mission/type/v2?tid=194&from=0
验证TAG
GET
https://member.bilibili.com/x/app/h5/archive/tag/info?tag_name=
提交投稿
https://member.bilibili.com/x/vu/web/add
POST
url
csrf:
data
json:
{
"copyright":1,
"videos":[
{
"filename":"m200524a23m79uhneooxzh3q99xe8xsq",
"title":"【SN76489音源】异度侵入ID INVADED OPミスターフィクサー_1",
"desc":""
}
],
"no_reprint":1,
"interactive":0,
"tid":分区tID,
"cover":"封面",
"title":"标题",
"tag":"TAG",
"desc_format_id":0,
"desc":"简介",
"dynamic":"同步动态内容",
"open_elec":允许充电,
"subtitle":{
"open":允许提交字幕,
"lan":""
}
}