When you need transcripts from an entire YouTube channel, playlist, or a list of research videos, making individual API calls for each video is inefficient. The YouTubeTranscripts.co batch API lets you process up to 25 videos in a single request, with server-side parallel processing for maximum speed.
How the Batch API Works
Instead of making 25 separate GET requests, you make one POST request with an array of YouTube URLs. The server processes all videos in parallel and returns an array of results. Each result includes the transcript or an error message if that specific video failed. You use one API credit per video in the batch.
Basic Batch Request
Send a POST request with a JSON body containing an array of URLs.
import httpx
response = httpx.post(
"https://api.youtubetranscripts.co/v1/batch",
json={
"urls": [
"https://youtube.com/watch?v=VIDEO1",
"https://youtube.com/watch?v=VIDEO2",
"https://youtube.com/watch?v=VIDEO3",
]
},
headers={"x-api-key": "YOUR_API_KEY"},
timeout=120,
)
results = response.json()
for item in results["transcripts"]:
if item.get("error"):
print(f"Failed: {item['url']} - {item['error']}")
else:
print(f"Success: {item['title']} ({len(item['transcript'])} segments)")Processing Large Lists
For more than 25 videos, split your list into batches of 25 and process them sequentially.
import httpx
API_KEY = "YOUR_API_KEY"
all_urls = [f"https://youtube.com/watch?v=VIDEO{i}" for i in range(100)]
all_transcripts = []
for i in range(0, len(all_urls), 25):
batch = all_urls[i:i + 25]
response = httpx.post(
"https://api.youtubetranscripts.co/v1/batch",
json={"urls": batch},
headers={"x-api-key": API_KEY},
timeout=120,
)
results = response.json()
all_transcripts.extend(results["transcripts"])
print(f"Processed batch {i // 25 + 1}: {len(batch)} videos")
successful = [t for t in all_transcripts if not t.get("error")]
print(f"\nTotal: {len(successful)}/{len(all_urls)} transcripts extracted")Error Handling in Batches
Each video in a batch is processed independently. If one video fails (private, deleted, or unavailable), the rest still succeed. Always check the error field in each result.
results = response.json()
successes = []
failures = []
for item in results["transcripts"]:
if item.get("error"):
failures.append({"url": item["url"], "error": item["error"]})
else:
successes.append(item)
print(f"Successes: {len(successes)}")
print(f"Failures: {len(failures)}")
for f in failures:
print(f" {f['url']}: {f['error']}")cURL Batch Example
You can also use the batch API from the command line.
curl -X POST \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://youtube.com/watch?v=V1", "https://youtube.com/watch?v=V2"]}' \
"https://api.youtubetranscripts.co/v1/batch"Conclusion
The batch API is the most efficient way to process multiple YouTube videos. Use it for channel analysis, playlist processing, and building large datasets. Combined with error handling and chunking, you can process thousands of videos reliably. Get started at youtubetranscripts.co.
Ready to start extracting YouTube transcripts?
Get 150 free API requests. No credit card required.
Get Your Free API Key