videoIdstring必填
The unique identifier for a YouTube video.
https://api.sandbase.ai/v1/api/youtube/video-detailGet public details for a YouTube video identified by video ID. Use it to inspect a known video before further content or comment analysis.
您的輸出會顯示在這裡
完成輸入後,點擊執行。
Returns public details for one YouTube video: title, description, view and like counts, channel info, thumbnails, music credits, related videos, and lists of audio, video and subtitle file links. It needs a videoId, such as dQw4w9WgXcQ.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-detail" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"videoId": "dQw4w9WgXcQ"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
videoId | string | Yes | The unique identifier for a YouTube video. |
lang | string | No | Optional IETF language tag for localized video details, such as en-US. Leave empty to use the default language. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"audios": {
"errorId": "Success",
"expiration": 1793713698,
"items": [
{
"extension": "m4a",
"isDrc": false,
"lastModified": 1766955925572207,
"lengthMs": 213089,
"mimeType": "audio/mp4; codecs=\"mp4a.40.2\"",
"size": 3449447,
"sizeText": "3.3MB",
"url": "https://redirector.googlevideo.com/videoplayback?expire=1793713698&ei=wpHpao6zJ4…"
}
]
},
"channel": {
"avatar": [
{
"height": 48,
"url": "https://yt3.ggpht.com/_ShEGOdg-t5YGJse14Ooq6FYBZqX_QSlhaTNjG06miYusm5lWm1UroLyVx…",
"width": 48
}
],
"handle": "@RickAstleyYT",
"id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"isVerified": true,
"isVerifiedArtist": true,
"name": "Rick Astley",
"subscriberCountText": "4.56M subscribers",
"type": "channel"
},
"commentCountText": "2.4M",
"description": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Au…",
"errorId": "Success",
"id": "dQw4w9WgXcQ",
"isCommentDisabled": false,
"isLiveNow": false,
"isLiveStream": false,
"isRegionRestricted": false,
"isUnlisted": false,
"lengthSeconds": 213
}
| Field | Meaning |
|---|---|
id / title / description | The video ID, the video title, and the start of the video description. |
viewCount / likeCount | Total views and likes as plain numbers. |
commentCountText | Comment count as display text, such as 2.4M. |
lengthSeconds | Video length in seconds. |
publishedTime / publishedTimeText | Publish time as an ISO 8601 timestamp with a UTC offset, and the same date as display text. |
isLiveNow / isLiveStream / isUnlisted / isRegionRestricted / isCommentDisabled | Boolean flags that show whether the video is live, a live stream, unlisted, region restricted, or has comments turned off. |
channel.id / channel.handle / channel.name | ID, handle and name of the channel that published the video. |
channel.subscriberCountText / channel.isVerified | Subscriber count as display text, and whether the channel is verified. |
musicCredits[].title / musicCredits[].artist / musicCredits[].album | Song title, artist and album listed for the video. |
related.items[].id / related.items[].title / related.items[].viewCountText | ID, title and view count text of each related video. |
videos.items[].quality / videos.items[].url / audios.items[].url | Quality label and file link for each video or audio stream. The hasAudio field shows whether a video file includes sound. |
subtitles.items[].code / subtitles.items[].url | Language code and file link for each subtitle track. |
videoId from a YouTube watch URL, where it follows v=. Video IDs in this response, such as E9de-cmycx8, are 11 characters.lang as a language tag such as en-US to get localized details. Leave it out for the default language.expiration value, a Unix timestamp in seconds. Use the links before that time.related.nextToken to continue the related video list. For comments, call YouTube Video Comments.$0.014286 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/youtube/video-detail" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"videoId": "dQw4w9WgXcQ"
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
videoIdstring必填The unique identifier for a YouTube video.
langstringOptional IETF language tag for localized video details, such as en-US. Leave empty to use the default language.
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
尚未發布已儲存回應。請在 Playground 中執行 API 以檢視其回應。
探索更多
| API | 價格 | 回應 |
|---|---|---|
YouTube | 每次呼叫 $0.014286 | JSON |
YouTube | 每次呼叫 $0.00045 起 | JSON |
YouTube | 每次呼叫 $0.0012 起 | JSON |
YouTube | 每次呼叫 $0.0012 起 | JSON |
YouTube | 每次呼叫 $0.0012 起 | JSON |
YouTube | 每次呼叫 $0.014286 | JSON |
問題
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/youtube/video-detail。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.014286,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:videoId (string)。 選填:lang (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。YouTube Video Details 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 YouTube API 存取權。