Sand AISand AI MAGI-2MAGI-2 artık SandBase'de: yerel sesli 1080p videoŞimdi deneyin

YouTube Video Captions

API dokümanları
https://api.sandbase.ai/v1/api/youtube/video-captions

Get 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.

Fiyat
$0.014286USD / çağrı
Yöntem
POST
Yanıt
JSON
Parametreler
1 gerekli · 2 isteğe bağlı

Oynatma Alanı

Girdi
The unique identifier for a YouTube video.
Caption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.
Caption output format.
ÇıktıHazır

Çıktınız burada görünecek

Girdileri tamamlayın, ardından Çalıştır'a tıklayın.

API README

YouTube Video Captions API

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.

Use cases

  • List which caption languages a video offers before you decide what to download.
  • Check whether a video has English captions before you queue it for transcription.
  • Build a language picker for a video player or localization tool from the track list.
  • Collect caption text in srt, xml, json3, or txt format for text analysis.

Request

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.

Parameters

NameTypeRequiredDescription
videoIdstringYesThe unique identifier for a YouTube video.
formatstringNoCaption output format.
languageCodestringNoCaption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.

Example response

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"
}

Response fields

FieldMeaning
video_idThe 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_codeThe 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_nameThe language name for the track in English, such as English or German.

Notes

Pricing

$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Daha fazlasını keşfedin

İlgili APIs

Tüm APIs
APIFiyatYanıt
YouTube$0.014286 çağrı başınaJSON
YouTubeKullanım başına $0.00045'den itibarenJSON
YouTubeKullanım başına $0.0012'den itibarenJSON
YouTubeKullanım başına $0.0012'den itibarenJSON
YouTubeKullanım başına $0.0012'den itibarenJSON
YouTube$0.014286 çağrı başınaJSON

Kılavuzlar:Best YouTube API in 2026: Pricing Compared

Sorular

SSS

YouTube Video Captions API'sini nasıl kullanırım?

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.

YouTube Video Captions API'sinin fiyatı nedir?

çağrı başına $0.014286, SandBase bakiyenizden tahsil edilir. Yalnızca yaptığınız çağrılar için ücretlendirilirsiniz; abonelik yoktur.

YouTube Video Captions API'si hangi parametreleri kabul eder?

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.

YouTube Video Captions API'si ne döndürür?

Aynı HTTP isteğinde döndürülen bir JSON yanıtı (senkron). Bu sayfadaki README'de örnek bir yanıt yer alır.

Bir YouTube geliştirici hesabına veya API anahtarına ihtiyacım var mı?

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.