YouTube bulk transcripts API
Transcripts of up to 10 YouTube videos in one call; videos without captions are listed in missing.
POST /v1/youtube/transcripts/batchBeta15 credits per callRefunded on failureimport os, requests
res = requests.post(
"https://api.groundsocial.dev/v1/youtube/transcripts/batch",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
json={"ids":["dQw4w9WgXcQ","AVO0ifle-OU"]},
)
res.raise_for_status()
data = res.json()Response
200 · 15 credits{ "kind": "youtube#transcriptListResponse", "items": [ { "kind": "youtube#transcript", "videoId": "dQw4w9WgXcQ", "languageCode": "en", "languageName": "English", "isAutoGenerated": false, "isTranslated": false, "text": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ♪ A full commitment's what I'm thinking of ♪ ♪ Y…", "segments": [ { "startMs": 1360, "durationMs": 1680, "text": "[♪♪♪]" }, { "startMs": 18640, "durationMs": 3240, "text": "♪ We're no strangers to love ♪" }, "… 18 more" ], "availableLanguages": [ { "languageCode": "en", "name": "English", "isAutoGenerated": false, "isTranslatable": true }, { "languageCode": "en", "name": "English (auto-generated)", "isAutoGenerated": true, "isTranslatable": true }, "… 4 more" ] } ], "pageInfo": { "totalResults": 1, "resultsPerPage": 1 }, "missing": [ { "id": "AVO0ifle-OU", "reason": "not_found" } ]}Response fields
200 with a YouTubeTranscriptList, in the shape of YouTube Data API v3 resources.
| Field | Type | Description |
|---|---|---|
kind | "youtube#transcriptListResponse" | |
items | YouTubeTranscript[] | |
pageInfo | object | |
missing | object[] | Videos with no transcript to read (no captions, private, missing), and why. |
Status codes
| Status | Meaning |
|---|---|
200 | The transcripts, and the videos without one. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The video, channel, playlist or post does not exist, was removed, or has nothing there. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | YouTube is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
Is a call with no transcripts charged?
No: if none of the videos has a readable transcript the call is refunded.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.