idstring
YouTube video ID. A Short uses the same ID as any other video.
https://api.sandbase.ai/v1/api/youtube/video-transcriptFetch the transcript/captions of a YouTube video or Short by URL or ID.
Ihre Ausgabe wird hier angezeigt
Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.
Returns the transcript of a YouTube video or Short as plain text and as timed segments. You pass either a video url or a video id.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-transcript" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | YouTube video ID. A Short uses the same ID as any other video. |
url | string | No | Full YouTube video URL. Shorts (youtube.com/shorts/...), youtu.be, live, and embed URLs all work. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"language": "en",
"segments": [
{
"durationSeconds": 1.68,
"startSeconds": 1.36,
"text": "[♪♪♪]"
}
],
"transcript": "[♪♪♪]\n♪ We're no strangers to love ♪\n♪ You know the rules and so do I ♪\n♪ A full…"
},
"found": true
}
| Field | Meaning |
|---|---|
found | true when a transcript was found for the video. A lookup that finds nothing returns found: false. |
data.language | Language code of the transcript, for example en. |
data.transcript | The full transcript as one string. Each caption line is separated by a newline. |
data.segments[].text | The text of one caption line. Music cues such as [♪♪♪] can appear as text. |
data.segments[].startSeconds | Start time of the segment, in seconds from the beginning of the video. |
data.segments[].durationSeconds | How long the segment lasts, in seconds. |
url or id. A Short uses the same ID as any other video, and youtube.com/shorts/..., youtu.be, live, and embed URLs all work for url.id is the value after v= in a standard watch URL, for example dQw4w9WgXcQ.data.transcript for the whole text and data.segments when you need timing.Billed at the actual cost of each call, about $0.0009 for the request above. Failed calls are not charged.
Jetzt loslegen
Plattform-API-Endpunkt mit einheitlicher Authentifizierung und Nutzungsnachverfolgung.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-transcript" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'Legen Sie Ihren SandBase API-Schlüssel in Ihrer Serverumgebung fest. Anfragen verwenden Bearer-Authentifizierung.
export SANDBASE_API_KEY="YOUR_API_KEY"Bewahren Sie Ihren Schlüssel auf dem Server auf. Geben Sie ihn nicht in Browser-Code preis.
idstringYouTube video ID. A Short uses the same ID as any other video.
urlstringFull YouTube video URL. Shorts (youtube.com/shorts/...), youtu.be, live, and embed URLs all work.
Gespeicherte Beispielantwort für diese API; beim Anzeigen wird keine Live-Anfrage gesendet.
Es wurde keine gespeicherte Antwort veröffentlicht. Führen Sie die API in Playground aus, um die Antwort zu prüfen.
Mehr entdecken
| API | Preis | Antwort |
|---|---|---|
YouTube Video TranscriptDiese API YouTube | Ab $0.0009 pro Aufruf | JSON |
YouTube | Ab $0.00045 pro Aufruf | JSON |
YouTube | Ab $0.0012 pro Aufruf | JSON |
YouTube | Ab $0.0012 pro Aufruf | JSON |
YouTube | Ab $0.0012 pro Aufruf | JSON |
YouTube | $0.014286 pro Aufruf | JSON |
Anleitungen:Best YouTube API in 2026: Pricing Compared
Fragen
Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/youtube/video-transcript mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.
Ab $0.0009 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.
Es sind keine Parameter erforderlich. Optional: id (string) und url (string). Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.
Eine JSON-Antwort, die in derselben HTTP-Anfrage zurückgegeben wird (synchron). Die README auf dieser Seite enthält eine Beispielantwort.
Nein. YouTube Video Transcript läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für YouTube API beantragen.