bv_idstring必須
Video id
https://api.sandbase.ai/v1/api/bilibili/web/video-partsReturns video part details for a specified Bilibili video using its video ID. The response includes the duration and creation timestamp for each segment.
[
{
"data": {
"code": 0,
"data": [
{
"cid": 42329116378,
"ctime": 1790748319,
"dimension": {
"height": 2160,
"rotate": 0,
"width": 3840
},
"duration": 1171,
"first_frame": "http://i1.hdslb.com/bfs/storyff/_000029mksn8nfp3wi26eln302viuwxb_firsti.jpg",
"from": "vupload",
"page": 1,
"part": "老Y蜜月之旅 | 马尔代夫菲诺芙",
"vid": "",
"weblink": ""
}
],
"message": "OK",
"ttl": 1
}
}
]例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
Returns the list of parts (pages) of a Bilibili video. It needs the video's BV ID in bv_id. Each part comes with its cid, title, duration, resolution and first-frame image.
duration values to get the total running time of a multi-part video.cid to use in other video calls that ask for a part-level ID.curl -X POST "https://api.sandbase.ai/v1/api/bilibili/web/video-parts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"bv_id": "BV1dFad6aEz9"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
bv_id | string | Yes | Video id |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"code": 0,
"data": [
{
"asr_language": "eng",
"cid": 42329116378,
"ctime": 1790748319,
"dimension": {
"height": 2160,
"rotate": 0,
"width": 3840
},
"duration": 1171,
"first_frame": "http://i1.hdslb.com/bfs/storyff/_000029mksn8nfp3wi26eln302viuwxb_firsti.jpg",
"from": "vupload",
"page": 1,
"part": "老Y蜜月之旅 | 马尔代夫菲诺芙",
"vid": "",
"weblink": ""
}
],
"message": "OK",
"ttl": 1
}
| Field | Meaning |
|---|---|
data[].page | Position of the part in the video, starting at 1. |
data[].part | Title of the part. |
data[].cid | Numeric ID of the part. |
data[].duration | Length of the part. The value 1171 for this video suggests seconds, but the response does not state the unit. |
data[].ctime | Creation time of the part as a Unix timestamp. |
data[].dimension.width / data[].dimension.height | Pixel size of the part's video. data[].dimension.rotate gives the rotation value. |
data[].first_frame | URL of the first-frame image of the part. |
data[].asr_language | Language code for automatic speech recognition on the part, such as eng. |
data[].from | Source label for the part, such as vupload. |
code / message | Status of the request. code is 0 and message is OK on success. |
bv_id from the Bilibili video link. It starts with BV, for example BV1dFad6aEz9.data list has one item per part. A single-part video returns one item with page set to 1.$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-parts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bv_id": "BV1dFad6aEz9"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
bv_idstring必須Video id
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
[
{
"data": {
"code": 0,
"data": [
{
"cid": 42329116378,
"ctime": 1790748319,
"dimension": {
"height": 2160,
"rotate": 0,
"width": 3840
},
"duration": 1171,
"first_frame": "http://i1.hdslb.com/bfs/storyff/_000029mksn8nfp3wi26eln302viuwxb_firsti.jpg",
"from": "vupload",
"page": 1,
"part": "老Y蜜月之旅 | 马尔代夫菲诺芙",
"vid": "",
"weblink": ""
}
],
"message": "OK",
"ttl": 1
}
}
]さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Bilibili Video Partsこの 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 |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/bilibili/web/video-parts に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.001、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: bv_id (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Bilibili Video Parts は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Bilibili の API アクセスを別途申請する必要はありません。