urlstring必填
Video URL
https://api.sandbase.ai/v1/api/bilibili/web/video-play-infoReturns playback stream information, including video stream URLs, MIME types, and frame rates, for a single Bilibili video URL.
您的输出将显示在这里
完成输入,然后点击运行。
Returns playback stream information for one Bilibili video. It includes DASH video and audio stream URLs, codecs, MIME types, frame rates, and the quality levels on offer. The input is a Bilibili video page url.
curl -X POST "https://api.sandbase.ai/v1/api/bilibili/web/video-play-info" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.bilibili.com/video/BV1S5uKzzE4r"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Video URL |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"accept_description": [
"超清 4K"
],
"accept_format": "hdflv2,hdflv2,flv,flv720,flv480,mp4",
"accept_quality": [
120
],
"auto_qn_resp": {
"dyeid": "32720d4a99eabdba00eb79966ae98d09"
},
"cur_language": "",
"cur_production_type": 0,
"dash": {
"audio": [
{
"SegmentBase": {
"Initialization": "0-825",
"indexRange": "826-6089"
},
"backupUrl": [
"https://upos-sz-mirrorhw.bilivideo.com/upgcxcode/81/89/30966218981/30966218981-1…"
],
"backup_url": [
"https://upos-sz-mirrorhw.bilivideo.com/upgcxcode/81/89/30966218981/30966218981-1…"
],
"bandwidth": 75307,
"baseUrl": "https://upos-sz-mirrorhwo1.bilivideo.com/upgcxcode/81/89/30966218981/30966218981…",
"base_url": "https://upos-sz-mirrorhwo1.bilivideo.com/upgcxcode/81/89/30966218981/30966218981…",
"codecid": 0,
"codecs": "mp4a.40.2",
"frameRate": "",
"frame_rate": "",
"height": 0,
"id": 30216
}
],
"dolby": {
"audio": null,
"type": 0
},
"duration": 2177,
"flac": null,
"minBufferTime": 1.5,
"min_buffer_time": 1.5,
"video": [
{
"SegmentBase": {
"Initialization": "0-929",
"indexRange": "930-6193"
},
"backupUrl": [
"https://upos-sz-estgoss.bilivideo.com/upgcxcode/81/89/30966218981/30966218981-1-…"
],
"backup_url": [
"https://upos-sz-estgoss.bilivideo.com/upgcxcode/81/89/30966218981/30966218981-1-…"
],
"bandwidth": 261921,
"baseUrl": "https://upos-sz-estgoss.bilivideo.com/upgcxcode/81/89/30966218981/30966218981-1-…",
"base_url": "https://upos-sz-estgoss.bilivideo.com/upgcxcode/81/89/30966218981/30966218981-1-…",
"codecid": 7,
"codecs": "avc1.64001F",
"frameRate": "30.000",
"frame_rate": "30.000",
"height": 426,
"id": 32
}
]
},
"format": "flv480",
"from": "local",
"high_format": null,
"last_play_cid": 0,
"last_play_time": 0
}
| Field | Meaning |
|---|---|
dash.video[].baseUrl / base_url | Main URL of a video stream. backupUrl and backup_url list alternate URLs for the same stream. |
dash.video[].codecs / mimeType / frameRate | Codec string, MIME type and frame rate of a video stream. For example avc1.64001F, video/mp4 and 30.000. |
dash.video[].width / height / bandwidth | Frame size and bandwidth value of a video stream. |
dash.audio[].baseUrl / codecs / mimeType | Main URL, codec and MIME type of an audio stream. Audio streams are listed apart from video streams. |
dash.duration / timelength | Length of the video. dash.duration is 2177 and timelength is 2176490 in this response. |
accept_quality / accept_description | Quality codes (such as 120, 112, 80) and their text labels (such as 超清 4K). |
support_formats[].quality / display_desc / format / codecs[] | Each quality level on offer. It has a short label, a format name and a list of codecs for that level. |
quality / format | Quality code and format name of the streams in this response. Here they are 32 and flv480. |
dash.video[].SegmentBase / segment_base | Byte ranges for the initialization data and the index (initialization, index_range) of a stream. |
url, for example https://www.bilibili.com/video/BV1S5uKzzE4r.dash.video[] can hold several entries with the same id but different codecid and codecs values, so match on codec as well.url, so it has no pagination.$0.001 per successful call. Failed calls 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-play-info" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.bilibili.com/video/BV1S5uKzzE4r"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
urlstring必填Video URL
这是该 API 保存的示例响应;查看时不会发起实时请求。
尚未发布已保存的响应。请在 Playground 中运行 API 以查看其响应。
探索更多
| 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-play-info 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.001,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。
必填:url (string)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Bilibili Single Video Play Info 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Bilibili API 访问权限。