a_idstring必填
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
}
]
}
}
]选择一个示例,将其输入和结果加载到 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.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
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"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
a_idstring必填Video id
c_idstring必填Video cid
这是该 API 保存的示例响应;查看时不会发起实时请求。
[
{
"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
}
]
}
}
]探索更多
| API | 价格 | 响应 |
|---|---|---|
Bilibili | $0.001 每次调用 | JSON |
Bilibili | $0.001 每次调用 | JSON |
Bilibili | $0.001 每次调用 | JSON |
Bilibili | $0.001 每次调用 | JSON |
Bilibili | $0.001 每次调用 | JSON |
Bilibili | $0.001 每次调用 | JSON |
问题
向 https://api.sandbase.ai/v1/api/bilibili/web/video-subtitle 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.001。每个组织在每个 UTC 日可获得 100 次免费调用,适用于包括此接口在内的所有符合条件的 SandBase APIs;超过后,每次调用将按此价格从您的 SandBase 余额中扣费。无需订阅。
必填:a_id (string) 和 c_id (string)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Bilibili Video Subtitle Details 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Bilibili API 访问权限。