a_idstringbắt buộc
Video id
https://api.sandbase.ai/v1/api/bilibili/web/video-subtitleReturns subtitle data for a specified Bilibili video based on its video ID and CID. Helps retrieve available caption tracks and related metadata.
[
{
"data": {
"allow_submit": false,
"font_size_type": 0,
"lan": "",
"lan_doc": "",
"subtitle_position": null,
"subtitles": [
{
"ai_status": 2,
"ai_type": 0,
"id": 1689850260387946200,
"id_str": "1689850260387946240",
"is_lock": false,
"lan": "ai-zh",
"lan_doc": "中文",
"subtitle_url": "//aisubtitle.hdslb.com/bfs/ai_subtitle/prod/1140060817394522840048445829058a24de68ec57ef3a7c4ccbbd139b?auth_key=1787218445-49f99e66f1fd4e339748e2caae8ae793-0-210c99e3de5bfc93303f4ccf3635c042",
"subtitle_url_v2": "//subtitle.bilibili.com/S%13%1BP.%1D%28%29X%2CR%5Ej%1F%25w%0E%02H%5EHO4%14%7B4%08K@%3C%7B%00M%0B%0A%1AM%08%056N6$%0C0&%02%1E%01%09%0E%1A2V~%15AX%16EYSA_%0Cw%1A%5C%5Et%17TRYXQV%5DYQ%0FzvMa3%5COJ%1CJM3%1Az%13%10%0E%15%12%5E%08D%0B%5C%2CL%0D%5Du%16%02?auth_key=1787218445-49f99e66f1fd4e339748e2caae8ae793-0-210c99e3de5bfc93303f4ccf3635c042",
"type": 1
}
]
}
}
]Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.
List the subtitle tracks of a Bilibili video, including AI-generated Chinese subtitles, with a download URL for each track. Needs the video's aid and cid.
curl -X POST "https://api.sandbase.ai/v1/api/bilibili/web/video-subtitle" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"a_id": "114006081739452", "c_id": "28400484458"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
a_id | string | Yes | Video id |
c_id | string | Yes | Video cid |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"allow_submit": false,
"font_size_type": 0,
"lan": "",
"lan_doc": "",
"subtitle_position": null,
"subtitles": [
{
"ai_status": 2,
"ai_type": 0,
"id": 1689850260387946240,
"id_str": "1689850260387946240",
"is_lock": false,
"lan": "ai-zh",
"lan_doc": "中文",
"subtitle_url": "//aisubtitle.hdslb.com/bfs/ai_subtitle/prod/1140060817394522840048445829058a24de…",
"subtitle_url_v2": "//subtitle.bilibili.com/S%13%1BP.%1D%28%29X%2CR%5Ej%1F%25w%0E%02H%5EHO4%14%7B4%0…",
"type": 1
}
]
}
| Field | Meaning |
|---|---|
subtitles[] | Subtitle tracks. |
subtitles[].lan / lan_doc | Language code (ai-zh for AI Chinese) and its label. |
subtitles[].subtitle_url | Protocol-relative URL of the subtitle JSON; prefix it with https:. The file has body[] entries with from, to (seconds) and content. |
subtitles[].ai_type / ai_status | Set for AI-generated tracks. |
aid and cid from a video detail API; one video has one cid per part.subtitles list.$0.001 per successful call. Failed calls, including lookups whose target does not exist, 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/web/video-subtitle" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"a_id": "114006081739452",
"c_id": "28400484458"
}'Đặ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.
a_idstringbắt buộcVideo id
c_idstringbắt buộcVideo cid
Đâ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.
[
{
"data": {
"allow_submit": false,
"font_size_type": 0,
"lan": "",
"lan_doc": "",
"subtitle_position": null,
"subtitles": [
{
"ai_status": 2,
"ai_type": 0,
"id": 1689850260387946200,
"id_str": "1689850260387946240",
"is_lock": false,
"lan": "ai-zh",
"lan_doc": "中文",
"subtitle_url": "//aisubtitle.hdslb.com/bfs/ai_subtitle/prod/1140060817394522840048445829058a24de68ec57ef3a7c4ccbbd139b?auth_key=1787218445-49f99e66f1fd4e339748e2caae8ae793-0-210c99e3de5bfc93303f4ccf3635c042",
"subtitle_url_v2": "//subtitle.bilibili.com/S%13%1BP.%1D%28%29X%2CR%5Ej%1F%25w%0E%02H%5EHO4%14%7B4%08K@%3C%7B%00M%0B%0A%1AM%08%056N6$%0C0&%02%1E%01%09%0E%1A2V~%15AX%16EYSA_%0Cw%1A%5C%5Et%17TRYXQV%5DYQ%0FzvMa3%5COJ%1CJM3%1Az%13%10%0E%15%12%5E%08D%0B%5C%2CL%0D%5Du%16%02?auth_key=1787218445-49f99e66f1fd4e339748e2caae8ae793-0-210c99e3de5bfc93303f4ccf3635c042",
"type": 1
}
]
}
}
]Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
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 |
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/web/video-subtitle 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.001 mỗi lần gọi. Mỗi tổ chức được 100 lần gọi miễn phí mỗi ngày UTC, dùng chung cho các API SandBase đủ điều kiện, bao gồm API này; sau đó mỗi lần gọi sẽ được tính theo mức giá này từ số dư SandBase của bạn. Không có gói đăng ký.
Bắt buộc: a_id (string) và c_id (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 Subtitle Details 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.