Developer API

YouTube Transcript API — Extract Transcripts with One API Call (2026)

Production-ready YouTube Transcript API. Extract transcripts from any video with a single REST call. Python, JavaScript, and PHP SDKs. 150 free requests, <1.5s response time, 99.9% uptime.

$0
Free tier
50ms
Avg latency
99.9%
Uptime
James Chen
James Chen|Senior API Engineer
10 min read
YouTube Transcript API — extract transcripts with one API call, SDKs for Python, JavaScript, and PHP

The YouTubeTranscripts.co API lets you extract transcripts from any YouTube video with a single HTTP request. Unlike the open-source youtube-transcript-api Python package, this is a hosted API that works in production — no IP blocks, no proxy rotation, no YouTube anti-bot issues. Send a video URL, get back structured transcript data in under 1.5 seconds. SDKs available for Python, JavaScript, and PHP. 150 free requests included, no credit card required.

Quick Start — Get a Transcript in 30 Seconds

Three lines of code. That is all it takes to extract a YouTube transcript. Choose your language below.

# ─── curl ───────────────────────────────────────────────────
curl -X POST "https://api.youtubetranscripts.co/v1/transcript" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://youtube.com/watch?v=dQw4w9WgXcQ"}'

# ─── Python ─────────────────────────────────────────────────
pip install youtubetranscripts

from youtubetranscripts import YouTubeTranscripts

client = YouTubeTranscripts(api_key="YOUR_API_KEY")
transcript = client.get_transcript("https://youtube.com/watch?v=dQw4w9WgXcQ")

print(transcript.text)           # Full text
print(transcript.word_count)     # 438
print(transcript.lang)           # "en"

for segment in transcript.content:
    print(f"[{segment.offset_ms}ms] {segment.text}")

# ─── JavaScript / Node.js ──────────────────────────────────
npm install youtubetranscripts

import { YouTubeTranscripts } from "youtubetranscripts";

const client = new YouTubeTranscripts({ apiKey: "YOUR_API_KEY" });
const transcript = await client.getTranscript(
  "https://youtube.com/watch?v=dQw4w9WgXcQ"
);

console.log(transcript.text);        // Full text
console.log(transcript.wordCount);   // 438

transcript.content.forEach((seg) => {
  console.log(`[${seg.offsetMs}ms] ${seg.text}`);
});

# ─── PHP ────────────────────────────────────────────────────
composer require youtubetranscripts/youtubetranscripts-php

use YouTubeTranscripts\Client;

$client = new Client('YOUR_API_KEY');
$transcript = $client->getTranscript('https://youtube.com/watch?v=dQw4w9WgXcQ');

echo $transcript->text;
echo $transcript->wordCount;  // 438
api.youtubetranscripts.co
POST/v1/transcript
200 OK1.2s
{
  "video_id": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up",
  "lang": "en",
  "source": "caption_auto",
  "word_count": 438,
  "duration_ms": 213000,
  "requests_used": 1,
  "balance_remaining": 149,
  "content": [
    { "text": "Never gonna give you up",  "offset_ms": 18400, "duration_ms": 2040 },
    { "text": "Never gonna let you down", "offset_ms": 20440, "duration_ms": 1660 },
    { "text": "Never gonna run around",   "offset_ms": 22100, "duration_ms": 1700 },
    { "text": "and desert you",           "offset_ms": 23800, "duration_ms": 1400 }
  ]
}

API Reference — Endpoints, Parameters, and Responses

The YouTubeTranscripts.co API has three endpoints. All requests use the x-api-key header for authentication and return JSON responses.

# POST /v1/transcript — Request body parameters
{
  "url": "string",          # Required. YouTube video URL or video ID.
  "lang": "string",         # Optional. Language code (e.g., "en", "es", "ja"). Auto-detected if omitted.
  "format": "string",       # Optional. "json" (default), "text", "srt", "vtt".
  "ai_fallback": true,      # Optional. Enable Whisper AI for uncaptioned videos. Default: true.
  "preserve_formatting": false  # Optional. Keep line breaks from original captions. Default: false.
}

# POST /v1/transcript/batch — Request body
{
  "urls": ["string"],       # Required. Array of 1-25 YouTube URLs.
  "lang": "string",         # Optional. Applied to all videos.
  "format": "string"        # Optional. Applied to all videos.
}

# Response headers (all endpoints)
# X-RateLimit-Limit: 60         (requests per minute)
# X-RateLimit-Remaining: 58     (remaining in current window)
# X-RateLimit-Reset: 1714200000 (Unix timestamp when window resets)
EndpointMethodDescriptionAuth Required
/v1/transcriptPOSTExtract transcript from a single YouTube videoYes
/v1/transcript/batchPOSTExtract transcripts from up to 25 videos in one requestYes
/v1/accountGETCheck API key status, remaining balance, and usage statsYes

SDK Installation — Python, JavaScript, PHP

Official SDKs wrap the REST API with typed responses, automatic retries, and error handling. Install with a single command.

# Python (PyPI)
pip install youtubetranscripts

# JavaScript / TypeScript (npm)
npm install youtubetranscripts

# PHP (Composer)
composer require youtubetranscripts/youtubetranscripts-php
SDKPackage ManagerMin VersionTyped Responses
Pythonpip (PyPI)Python 3.8+Yes (dataclasses)
JavaScriptnpmNode.js 18+Yes (TypeScript)
PHPComposer (Packagist)PHP 8.1+Yes (typed classes)

Authentication and Rate Limits

All API requests require an API key passed in the x-api-key header. Keys are free and created instantly at youtubetranscripts.co/login.

1

Get your API key

Sign up at youtubetranscripts.co/login with email or Google. Your API key is generated instantly — no approval process, no credit card. Copy it from the dashboard.

2

Add the key to your requests

Include the header x-api-key: YOUR_API_KEY on every request. The key is a 32-character alphanumeric string. Store it in environment variables — never commit it to source control.

3

Monitor your usage

Every response includes requests_used and balance_remaining fields. Use GET /v1/account to check your current balance, usage history, and rate limit status at any time.

PlanRequestsRate LimitPriceAI Fallback
Free15060/min$0Yes
Starter500120/min$5Yes
Pro2,500300/min$20Yes
Business10,000600/min$65Yes
EnterpriseCustomCustomContact usYes + priority

Pricing — Pay Per Request, Credits Never Expire

No monthly subscriptions. Buy credits when you need them, and they never expire. Every plan includes full API access, all output formats, AI fallback, and batch processing.

Credits Never Expire

Buy once, use whenever. No monthly billing, no auto-renewal, no wasted credits at the end of the month.

All Features on Every Plan

Every plan — including Free — gets full API access, all output formats, AI fallback, batch processing, and all three SDKs. No feature gating.

Batch Requests Count as 1 per Video

A batch request with 25 URLs uses 25 credits — one per video. The batch endpoint itself does not cost extra.

PlanRequestsCost per RequestTotal PriceBest For
Free150$0.000$0Testing and prototyping
Starter500$0.010$5Side projects, MVPs
Pro2,500$0.008$20Production apps, SaaS integrations
Business10,000$0.0065$65High-volume pipelines
Enterprise50,000+$0.004CustomMedia companies, AI platforms

YouTubeTranscripts.co API vs youtube-transcript-api vs Supadata

Developers evaluating transcript APIs typically compare three options: our hosted API, the open-source youtube-transcript-api Python package, and Supadata's API. Here is an honest comparison.

FeatureYouTubeTranscripts.coyoutube-transcript-apiSupadata
TypeHosted REST APIPython library (local)Hosted REST API
Works in productionYesNo (IP blocked on cloud)Yes
AI fallbackYes (Whisper)NoYes
SDKsPython, JS, PHPPython onlyPython, JS
Batch endpoint25 videos/requestNoYes
Free tier150 requestsUnlimited (local only)100 requests
Response time<1.5sDepends on connection~2s
Rate limit (free)60/minN/A30/min
Cost per requestFrom $0.004Free (self-hosted)From $0.005
Feature
YouTubeTranscripts.co
youtube-transcript-api (Python)
Works in production (cloud/serverless)
No IP blocking by YouTube
AI fallback (Whisper)
JavaScript / PHP SDKs
Batch processing
25/request
Sequential only
Hosted (no infra needed)
Free tier
150 requests
Unlimited (localhost)
Open source

Error Handling and Status Codes

The API returns standard HTTP status codes and structured error responses. Every error includes a machine-readable code and a human-readable message.

# Error response format
{
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Your account has 0 remaining requests. Purchase credits at youtubetranscripts.co/pricing",
    "status": 402
  }
}

# Python SDK — error handling
from youtubetranscripts import YouTubeTranscripts, APIError, RateLimitError

client = YouTubeTranscripts(api_key="YOUR_API_KEY")

try:
    transcript = client.get_transcript("https://youtube.com/watch?v=VIDEO_ID")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds.")
except APIError as e:
    print(f"API error {e.status}: {e.code} — {e.message}")
Status CodeError CodeDescriptionResolution
400INVALID_URLThe URL is not a valid YouTube video linkCheck URL format — must be youtube.com/watch?v= or youtu.be/
401INVALID_API_KEYAPI key is missing or invalidCheck x-api-key header. Get a key at youtubetranscripts.co/login
402INSUFFICIENT_BALANCENo remaining credits on your accountPurchase additional credits at youtubetranscripts.co/pricing
404VIDEO_NOT_FOUNDThe video does not exist or is privateVerify the video ID. Private videos cannot be accessed.
429RATE_LIMITEDToo many requests in the current minuteWait until X-RateLimit-Reset. Implement exponential backoff.
500INTERNAL_ERRORServer error during transcript extractionRetry after 5 seconds. If persistent, contact support.

Frequently Asked Questions

Sign up at youtubetranscripts.co/login with your email or Google account. Your API key is generated instantly — no approval process, no credit card required. You start with 150 free requests. Copy the key from your dashboard and pass it in the x-api-key header.

The youtube-transcript-api Python package is an open-source library that calls YouTube directly from your server. It works on localhost but gets IP-blocked when deployed to cloud services (AWS, GCP, Vercel, Railway). YouTubeTranscripts.co is a hosted API that handles proxy rotation and anti-bot measures — your production app never breaks.

The free tier includes 150 requests with no credit card. Paid plans start at $5 for 500 requests ($0.01/request). Volume discounts bring the cost down to $0.004/request at the Enterprise tier. Credits never expire — no monthly billing.

The free tier allows 60 requests per minute. Paid plans scale up to 600/min (Business) and custom limits (Enterprise). Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) are included in every response so you can implement backoff logic.

Yes. POST to /v1/transcript/batch with an array of up to 25 YouTube URLs. All videos are processed in parallel. Each video costs 1 credit. The response is a JSON array with one result per video, including any errors for individual URLs.

The API supports 100+ languages. Language is auto-detected from the video's available captions. You can override this with the lang parameter (ISO 639-1 codes: 'en', 'es', 'ja', 'de', etc.). AI fallback via Whisper supports the same 100+ languages.

Yes. When ai_fallback is enabled (the default), the API uses OpenAI Whisper to transcribe the audio of uncaptioned videos. The response includes source: 'ai_generated' so you know which method was used. AI transcription adds 5-15 seconds to response time.

Official SDKs exist for Python (pip install youtubetranscripts), JavaScript/TypeScript (npm install youtubetranscripts), and PHP (composer require youtubetranscripts/youtubetranscripts-php). All SDKs provide typed responses, automatic retries on 429/500 errors, and batch support.

Implement exponential backoff for 429 (rate limit) and 500 (server error) responses. The SDKs handle this automatically with 3 retries. Check the X-RateLimit-Remaining header to proactively throttle requests before hitting the limit. Use the /v1/account endpoint to monitor your credit balance.

Yes. The API is designed for integration into production applications. Business and Enterprise plans offer the throughput needed for SaaS products. There are no restrictions on commercial use. If you need a custom rate limit, SLA, or dedicated infrastructure, contact us for an Enterprise plan.

Related Resources

Start Building with the YouTube Transcript API

150 free requests. No credit card. Python, JavaScript, and PHP SDKs. Get your API key in 30 seconds.