Quickstart
Make your first request in under a minute.
1. Get an API key
Sign up for free — you get 100 credits with no credit card. Inside the dashboard, go to API Keys and click Create new key. Copy the full token (it's only shown once) and store it as an environment variable in your project.
export API_KEY=tk_live_xxxxxxxxxxxxxxxxxxxx2. Make a request
The simplest call: fetch a transcript by video ID.
curl -X GET "https://youtubetranscriptapi.com/api/v2/youtube/transcript?video_url=dQw4w9WgXcQ" \
-H "Authorization: Bearer $API_KEY"A video not fetched before usually takes 10–30 seconds; videos already fetched return in about a second. Set your HTTP client timeout to at least 60 seconds.
The response includes the video ID, language, and a list of transcript segments.
{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [
{ "text": "First caption line", "start": 0, "duration": 4.12 },
{ "text": "Second caption line", "start": 4.12, "duration": 3.85 }
]
}3. Handle errors and rate limits
Successful responses include X-RateLimit-* headers and an X-Cache-Status header (HIT or MISS), plus X-Credits-Charged and X-Credits-Remaining with your balance. Most errors carry the rate-limit headers too; 401, 403 and a 503 from a failed account check don't. On 429, 408 and 503 we'll return a Retry-After header. See the errors guide for the full list of status codes and the retry policy we recommend.
Where to next
- Full API Reference — every endpoint and field.
- Step-by-step guides for Python, JavaScript & Node.js and cURL & REST.
- Authentication & key rotation.
- Agent Skills for Claude Code and other coding agents.