YouTube Transcript API: Get Transcripts for Your App

Need to get YouTube transcripts for your app or website? The YouTube Transcript API lets you fetch video transcripts programmatically. This guide explains how to use it.

With an API, you can automate transcript extraction. No manual copying needed. Perfect for developers building apps, tools, or content platforms.

What is the YouTube Transcript API?

A transcript API is a service that returns video transcripts in a format your code can use (usually JSON). You send a video ID, and the API sends back the transcript text.

YoutubeTS offers a simple REST API for getting YouTube transcripts. It is easy to use and works with any programming language.

Why Use a Transcript API?

Here are common use cases:

How the YoutubeTS API Works

Our API is simple to use:

1. Get an API Key

Sign up at YoutubeTS.com and get your API key from the dashboard. API keys are available on paid plans.

2. Make an API Request

Send a request to our API endpoint with the video ID.

3. Get JSON Response

The API returns the transcript in JSON format. You can parse this in your code.

API Request Example

Here is how to make an API request:

GET https://youtubets.com/api/v1/transcript?video_id=VIDEO_ID
Headers:
  Authorization: Bearer YOUR_API_KEY
  Accept: application/json

Parameters:

ParameterRequiredDescription
video_idYesThe YouTube video ID (11 characters)

API Response Example

The API returns a JSON response like this:

{
  "success": true,
  "video_id": "dQw4w9WgXcQ",
  "video_title": "Video Title Here",
  "language": "English",
  "language_code": "en",
  "transcript": [
    {
      "text": "Hello everyone",
      "start": 0.0,
      "duration": 2.5
    },
    {
      "text": "Welcome to this video",
      "start": 2.5,
      "duration": 3.0
    }
  ],
  "full_text": "Hello everyone Welcome to this video..."
}

Response Fields:

FieldTypeDescription
successbooleanWhether the request was successful
video_idstringThe YouTube video ID
video_titlestringTitle of the video
languagestringLanguage of the transcript
language_codestringISO language code
transcriptarrayArray of transcript segments with timestamps
full_textstringComplete transcript as plain text

Code Examples

Python Example

import requests

api_key = "YOUR_API_KEY"
video_id = "dQw4w9WgXcQ"

response = requests.get(
    f"https://youtubets.com/api/v1/transcript",
    params={"video_id": video_id},
    headers={"Authorization": f"Bearer {api_key}"}
)

data = response.json()
print(data["full_text"])

JavaScript Example

const apiKey = "YOUR_API_KEY";
const videoId = "dQw4w9WgXcQ";

fetch(`https://youtubets.com/api/v1/transcript?video_id=${videoId}`, {
    headers: {
        "Authorization": `Bearer ${apiKey}`,
        "Accept": "application/json"
    }
})
.then(response => response.json())
.then(data => console.log(data.full_text));

PHP Example

$apiKey = "YOUR_API_KEY";
$videoId = "dQw4w9WgXcQ";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://youtubets.com/api/v1/transcript?video_id=" . $videoId);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer " . $apiKey,
    "Accept: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);

echo $data["full_text"];

Error Handling

The API returns error responses when something goes wrong:

{
  "success": false,
  "error": "No transcript available for this video"
}

Common Error Codes:

HTTP CodeMeaning
200Success
400Invalid video ID or no transcript
401Invalid or missing API key
429Rate limit exceeded
500Server error

Rate Limits

API rate limits depend on your plan:

PlanRequests/Month
FreeNot available
Pro1,000 requests
Business10,000 requests
EnterpriseCustom

Need more? Contact us for enterprise pricing.

API Best Practices

1. Cache Results

Store transcripts in your database. Do not request the same video multiple times. This saves API calls and makes your app faster.

2. Handle Errors Gracefully

Some videos have no transcripts. Your code should handle these cases without crashing.

3. Respect Rate Limits

Do not make too many requests at once. Space out your requests to avoid hitting limits.

4. Secure Your API Key

Never expose your API key in client-side code. Keep it on your server only.

Get API Access

Ready to start using the YouTube Transcript API?

  1. Sign up at YoutubeTS.com
  2. Choose a plan with API access
  3. Get your API key from the dashboard
  4. Start making requests

View API Pricing

Related Articles

Last updated: February 13, 2026