Sand AISand AI MAGI-2MAGI-2 è ora su SandBase: video in 1080p con audio nativoProvalo ora

YouTube Video Captions

Documentazione API
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.

Prezzo
$0.014286USD / chiamata
Metodo
POST
Risposta
JSON
Parametri
1 obbligatori · 2 opzionali

Playground

Input
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.
OutputPronto

Il tuo output apparirà qui

Completa gli input, poi fai clic su Esegui.

README API

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.

Esplora altro

API correlate

Tutte le API
APIPrezzoRisposta
YouTube$0.014286 per chiamataJSON
YouTubeDa $0.00045 per chiamataJSON
YouTubeDa $0.0012 per chiamataJSON
YouTubeDa $0.0012 per chiamataJSON
YouTubeDa $0.0012 per chiamataJSON
YouTube$0.014286 per chiamataJSON

Guide:Best YouTube API in 2026: Pricing Compared

Domande

FAQ

Come uso l'API YouTube Video Captions?

Invia una richiesta POST a https://api.sandbase.ai/v1/api/youtube/video-captions con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.

Quanto costa l'API YouTube Video Captions?

$0.014286 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.

Quali parametri accetta l'API YouTube Video Captions?

Richiesti: videoId (string). Facoltativi: languageCode (string) e format (uno tra srt, xml, json3, txt). La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.

Cosa restituisce l'API YouTube Video Captions?

Una risposta JSON restituita nella stessa richiesta HTTP (sincrona). Il README di questa pagina include una risposta di esempio.

Mi serve un account sviluppatore o una chiave API YouTube?

No. YouTube Video Captions funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API YouTube.