videoIdstringzorunlu
The unique identifier for a YouTube video.
https://api.sandbase.ai/v1/api/youtube/video-captionsGet available caption tracks for a YouTube video or request captions in SRT, XML, JSON3, or plain-text format. Use it to support transcription, accessibility, localization, or text analysis.
Çıktınız burada görünecek
Girdileri tamamlayın, ardından Çalıştır'a tıklayın.
This API returns the caption tracks available for a YouTube video. It needs a videoId. If you also pass languageCode, it returns the captions for that language in the format you set with format.
srt, xml, json3, or txt format for text analysis.curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-captions" \
-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. |
format | string | No | Caption output format. |
languageCode | string | No | Caption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"captions": [
{
"language_code": "en",
"language_name": "English"
}
],
"video_id": "dQw4w9WgXcQ"
}
| Field | Meaning |
|---|---|
video_id | The ID of the video the caption tracks belong to. It matches the videoId you sent. |
captions[] | One entry for each caption track available for the video. |
captions[].language_code | The code for the track language, such as en, de, or ja. Pass this value as languageCode to request the captions for that track. |
captions[].language_name | The language name for the track in English, such as English or German. |
videoId to get the list of tracks. Add languageCode to request the caption content.format accepts srt, xml, json3, or txt. The default is srt.videoId from a video URL, or from YouTube Search or YouTube Channel Videos.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Geliştirmeye başlayın
Birleşik kimlik doğrulama ve kullanım takibi sunan Platform API uç noktası.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-captions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "srt",
"videoId": "dQw4w9WgXcQ"
}'SandBase API anahtarınızı sunucu ortamınıza ayarlayın. İstekler Bearer kimlik doğrulaması kullanır.
export SANDBASE_API_KEY="YOUR_API_KEY"Anahtarınızı sunucuda tutun. Tarayıcı kodunda açığa çıkarmayın.
videoIdstringzorunluThe unique identifier for a YouTube video.
languageCodestringCaption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.
formatstringCaption output format.
Varsayılan: "srt"
Olası değerler: srt, xml, json3, txt
Bu API için kaydedilmiş örnek yanıt; görüntülerken canlı istek yapılmaz.
Yayınlanmış bir kaydedilmiş yanıt yok. Yanıtını incelemek için API'yi Playground'da çalıştırın.
Daha fazlasını keşfedin
| API | Fiyat | Yanıt |
|---|---|---|
YouTube Video CaptionsBu API YouTube | $0.014286 çağrı başına | JSON |
YouTube | Kullanım başına $0.00045'den itibaren | JSON |
YouTube | Kullanım başına $0.0012'den itibaren | JSON |
YouTube | Kullanım başına $0.0012'den itibaren | JSON |
YouTube | Kullanım başına $0.0012'den itibaren | JSON |
YouTube | $0.014286 çağrı başına | JSON |
Kılavuzlar:Best YouTube API in 2026: Pricing Compared
Sorular
SandBase API anahtarınızı Authorization başlığında (Bearer) ve parametreleri JSON gövdesi olarak ile https://api.sandbase.ai/v1/api/youtube/video-captions adresine bir POST isteği gönderin. Ayrıca bu sayfadaki Playground’da kod yazmadan da deneyebilirsiniz.
çağrı başına $0.014286, SandBase bakiyenizden tahsil edilir. Yalnızca yaptığınız çağrılar için ücretlendirilirsiniz; abonelik yoktur.
Gerekli: videoId (string). İsteğe bağlı: languageCode (string) ve format (srt, xml, json3, txt arasından biri). Parametreler tablosu ve bu sayfadaki Playground, tüm alanları listeler.
Aynı HTTP isteğinde döndürülen bir JSON yanıtı (senkron). Bu sayfadaki README'de örnek bir yanıt yer alır.
Hayır. YouTube Video Captions, SandBase üzerinden çalışır; bu nedenle tek bir SandBase API anahtarı bu uç noktayı ve katalogdaki diğer tüm API'leri ve modelleri kapsar. YouTube API erişimi için ayrıca başvuru yapmanız gerekmez.