Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Bilibili Video Danmaku

API 文档
https://api.sandbase.ai/v1/api/bilibili/video-danmu

Get one page of danmaku comments for a Bilibili video segment identified by AID and CID. Use it to review time-synchronized audience reactions or page through danmaku for a known video.

价格
$0.014286美元 / 次调用
方法
POST
响应
JSON
参数
2 个必填 · 1 个可选

Playground

输入
Bilibili Archive ID (AID).
Bilibili Chat ID (CID).
Page number for pagination.
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

Bilibili Video Danmaku API

Returns one page of danmaku (time-synced viewer comments) for a Bilibili video segment. It needs the video's aid and cid, and takes an optional page number.

Use cases

  • Read the on-screen audience reactions for a specific video segment.
  • Collect danmaku text for sentiment or keyword analysis on a known video.
  • Plot when viewers comment most by grouping entries on their stime value.
  • Page through all danmaku of a video by increasing page.

Request

curl -X POST "https://api.sandbase.ai/v1/api/bilibili/video-danmu" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"aid": "80433022", "cid": "137649199"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
aidstringYesBilibili Archive ID (AID).
cidstringYesBilibili Chat ID (CID).
pagestringNoPage number for pagination.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

[
  {
    "color": 16777215,
    "date": 1593092327,
    "dmid": "34576873522987015",
    "id": 34576873522987015,
    "mode": 1,
    "size": 25,
    "stime": 95453,
    "text": "80年代迪厅必放金曲",
    "uhash": "d2b24dbe",
    "weight": 9
  }
]

Response fields

FieldMeaning
textThe danmaku comment text shown on screen.
stimeTime position of the comment in the video. The value 95453 suggests milliseconds, but the response does not state the unit.
dateTime the comment was posted, as a Unix timestamp in seconds.
id / dmidUnique ID of the danmaku. dmid is the same number as id, returned as a string.
uhashHashed ID of the user who sent the comment. It is not a plain user ID.
colorComment color as a decimal number. The value 16777215 is white (#FFFFFF).
mode / size / weightDisplay mode, font size and weight value of the comment. All three are plain numbers.

Notes

  • The response is a top-level JSON array. Each item is one danmaku comment.
  • Use page to move through further pages for the same aid and cid.
  • To find the aid from a BV ID, call Bilibili BV to AID Converter.
  • To list the parts of a video and get their cid values, call Bilibili Video Parts.

Pricing

$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
Bilibili$0.014286 每次调用JSON
Bilibili$0.001 每次调用JSON
Bilibili$0.001 每次调用JSON
Bilibili$0.001 每次调用JSON
Bilibili$0.001 每次调用JSON
Bilibili$0.001 每次调用JSON

指南:Best Bilibili API in 2026: Pricing Compared

问题

常见问题

如何使用 Bilibili Video Danmaku API?

向 https://api.sandbase.ai/v1/api/bilibili/video-danmu 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Bilibili Video Danmaku API 的价格是多少?

每次调用 $0.014286,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Bilibili Video Danmaku API 接受哪些参数?

必填:aid (string) 和 cid (string)。 可选:page (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Bilibili Video Danmaku API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Bilibili 开发者账户或 API key 吗?

不需要。Bilibili Video Danmaku 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Bilibili API 访问权限。