@ikenxuan/amagi
API 参考

B站 API

B站平台 API 参考文档

B站 API

B站平台的所有 API 方法参考。

Fetcher 方法

fetchVideoInfo

获取单个视频作品数据。

const  = await ...({
  : 'BV1xx411c7mD',
  : 'strict'
})
参数类型必填说明
bvidstring视频 BV 号
typeMode'strict' | 'loose'类型模式

fetchVideoStreamUrl

获取视频下载信息。

const  = await ...({
  : 170001,
  : 279786
})
参数类型必填说明
avidnumber视频 AV 号
cidnumber视频 CID

fetchVideoDanmaku

获取视频实时弹幕。

const  = await ...({
  : 279786,
  : 1
})
参数类型必填说明
cidnumber视频 CID
segment_indexnumber分段索引,默认 1

fetchComments

获取评论数据。

const  = await ...({
  : '170001',
  : 1,
  : 20
})
参数类型必填说明
oidstring目标 ID
typenumber评论区类型
numbernumber每页数量

评论区类型: 1=视频, 11=图文动态, 12=专栏, 14=音频, 17=文字动态


fetchCommentReplies

获取指定评论的回复。

const  = await ...({
  : '170001',
  : 1,
  : '123456789'
})
参数类型必填说明
oidstring目标 ID
typenumber评论区类型
rootstring根评论 ID

fetchUserCard

获取用户主页数据。

const  = await ...({
  : 123456
})
参数类型必填说明
host_midnumber用户 UID

fetchUserDynamicList

获取用户主页动态列表。

const  = await ...({
  : 123456
})

fetchUserSpaceInfo

获取用户空间详细信息。

const  = await ...({
  : 123456
})

fetchUploaderTotalViews

获取 UP 主总播放量。

const  = await ...({
  : 123456
})

fetchDynamicDetail

获取动态详情。

const  = await ...({
  : '123456789'
})

fetchDynamicCard

获取动态卡片数据。

const  = await ...({
  : '123456789'
})

fetchBangumiInfo

获取番剧基本信息。

// 通过 ep_id
const  = await ...({
  : '123456'
})

// 或通过 season_id
const  = await ...({
  : '123456'
})
参数类型必填说明
ep_idstring二选一剧集 ID
season_idstring二选一季度 ID

fetchBangumiStreamUrl

获取番剧下载信息。

const  = await ...({
  : 279786,
  : '123456'
})

fetchLiveRoomInfo

获取直播间信息。

const  = await ...({
  : '123456'
})

fetchLiveRoomInitInfo

获取直播间初始化信息。

const  = await ...({
  : '123456'
})

fetchArticleContent

获取专栏正文内容。

const  = await ...({
  : '123456'
})

fetchArticleCards

获取专栏显示卡片信息。

const  = await ...({
  : ['123456', '789012']
})

fetchLoginStatus

获取登录基本信息。

const  = await ...({})

requestLoginQrcode

申请登录二维码。

const  = await ...({})

checkQrcodeStatus

检查二维码状态。

const  = await ...({
  : 'xxx'
})

convertAvToBv

AV 号转 BV 号。

const  = await ...({
  : 170001
})

convertBvToAv

BV 号转 AV 号。

const  = await ...({
  : 'BV1xx411c7mD'
})

fetchEmojiList

获取 Emoji 列表。

const  = await ...({})

On this page