文章目录

记录B站关于视频的api

由 Rorical 发布
随时更新,请不要用这些来麻烦哔哩哔哩

请注意,所有的接口请求时候务必带上cookie,referer和csrf_token

通过各种id获取视频详情

GET https://api.bilibili.com/x/web-interface/view?bvid=#视频bvid
GET https://api.bilibili.com/x/web-interface/view?aid=#视频avid

正常返回
{"code":0,"message":"0","ttl":1,"data":{"bvid":"#bvid","aid":#avid,"videos":#包含视频数量,"tid":#分区id,"tname":"#分区","copyright":1,"pic":"#头图","title":"#视频标题","pubdate":#发布时间,"ctime":#创建时间,"desc":"#视频简介","state":0,"attribute":#UnKnow,"duration":#UnKnow,"mission_id":#UnKnow,"rights":{"bp":0,"elec":0,"download":1,"movie":0,"pay":0,"hd5":1,"no_reprint":1,"autoplay":1,"ugc_pay":0,"is_cooperation":0,"ugc_pay_preview":0,"no_background":0},"owner":{"mid":#作者id,"name":"#作者名字","face":"#作者头像"},"stat":{"aid":avid,"view":#观看量,"danmaku":#弹幕,"reply":#评论,"favorite":#收藏,"coin":#投币,"share":#分享,"now_rank":0,"his_rank":0,"like":#点赞,"dislike":#差评,"evaluation":""},"dynamic":"分类?","cid":#UnKnow,"dimension":{"width":1920,"height":1080,"rotate":0},"no_cache":false,"pages":[{"cid":#UnKnow,"page":1,"from":"vupload","part":"fans","duration":#UnKnow,"vid":"","weblink":"","dimension":{"width":1920,"height":1080,"rotate":0}}],"subtitle":{"allow_submit":false,"list":[]}}}

获取视频简介

GET https://api.bilibili.com/x/web-interface/archive/desc?callback=#回调参数&aid=#视频avid&page=&jsonp=jsonp

正常返回
#回调函数({"code":0,"message":"0","ttl":1,"data":"#内容"})

获取视频tags

GET https://api.bilibili.com/x/tag/archive/tags?callback=#回调参数&aid=#视频avid&jsonp=jsonp

正常返回
#回调函数({"code":0,"message":"0","ttl":1,"data":[{"tag_id":716671,"tag_name":"饭圈","cover":"","head_cover":"","content":"","short_content":"","type":0,"state":0,"ctime":1436866637,"count":{"view":0,"use":7196,"atten":942},"is_atten":0,"likes":122,"hates":18,"attribute":1,"liked":1,"hated":0}]})

视频点赞接口

POST https://api.bilibili.com/x/web-interface/archive/like

aid: #视频avid
like: #1为点赞,2为取消

正常返回
{"code":0,"message":"0","ttl":1}

获取你有没有给这个视频点赞

GET https://api.bilibili.com/x/web-interface/archive/has/like?jsonp=jsonp&aid=#视频avid&callback=#回调函数

视频tag点赞接口

POST https://api.bilibili.com/x/tag/archive/like2

tag_id: #tag的id
aid: #视频avid
jsonp: jsonp

正常返回
{"code":0,"message":"0","ttl":1}
超出限制
{"code":16012,"message":"顶/踩太多次啦,休息休息~","ttl":1}

评论点赞

POST https://api.bilibili.com/x/v2/reply/action

oid: #视频avid
type: 1
rpid: #评论的id
action: #1点赞,0取消点赞
jsonp: jsonp

正常返回
{"code":0,"message":"0","ttl":1}

评论点踩

POST https://api.bilibili.com/x/v2/reply/hate

oid: #视频avid
type: 1
rpid: #评论的id
action: #1点赞,0取消点赞
jsonp: jsonp

正常返回
{"code":0,"message":"0","ttl":1}

唉。。。


6 条评论

  1. 茧居
    茧居 · 2020-08-06 15:07

    你好,最近网页加载的好慢,换了好几个浏览器都不行,请问有什么解决办法吗?

    1. 算得上是多
      算得上是多 · 2020-08-31 10:43

      拾掇拾掇

  2. 狸猫吃柠檬
    狸猫吃柠檬 · 2020-08-01 14:33

    你好呀

  3. qwe
    qwe · 2020-07-06 04:51

    第一个自定义头图大概率不会显示

  4. LD叶
    LD叶 · 2020-06-24 12:06

    ye!

  5. 匿名者乐园
    匿名者乐园 · 2020-05-21 09:00

    太棒了!感谢整理,以后就不用到处收集了!

发表评论