aidstringbắt buộc
Bilibili Archive ID (AID).
https://api.sandbase.ai/v1/api/bilibili/video-danmuGet 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.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
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.
stime value.page.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.
| Name | Type | Required | Description |
|---|---|---|---|
aid | string | Yes | Bilibili Archive ID (AID). |
cid | string | Yes | Bilibili Chat ID (CID). |
page | string | No | Page number for pagination. |
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
}
]
| Field | Meaning |
|---|---|
text | The danmaku comment text shown on screen. |
stime | Time position of the comment in the video. The value 95453 suggests milliseconds, but the response does not state the unit. |
date | Time the comment was posted, as a Unix timestamp in seconds. |
id / dmid | Unique ID of the danmaku. dmid is the same number as id, returned as a string. |
uhash | Hashed ID of the user who sent the comment. It is not a plain user ID. |
color | Comment color as a decimal number. The value 16777215 is white (#FFFFFF). |
mode / size / weight | Display mode, font size and weight value of the comment. All three are plain numbers. |
page to move through further pages for the same aid and cid.aid from a BV ID, call Bilibili BV to AID Converter.cid values, call Bilibili Video Parts.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
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"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
aidstringbắt buộcBilibili Archive ID (AID).
cidstringbắt buộcBilibili Chat ID (CID).
pagestringPage number for pagination.
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Bilibili Video DanmakuAPI này Bilibili | $0.014286 mỗi lần gọi | JSON |
Bilibili | $0.001 mỗi lần gọi | JSON |
Bilibili | $0.001 mỗi lần gọi | JSON |
Bilibili | $0.001 mỗi lần gọi | JSON |
Bilibili | $0.001 mỗi lần gọi | JSON |
Bilibili | $0.001 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/bilibili/video-danmu với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
$0.014286 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: aid (string) và cid (string). Tùy chọn: page (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Bilibili Video Danmaku chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Bilibili.