AI-Ready Text (`transcript`)
A beautifully concatenated, single string of text — perfect for feeding directly into ChatGPT, Claude, or your custom RAG pipelines without breaking tokenizers.
Welcome to the YouTube Transcript Pro API! This guide will show you how to quickly extract high-quality, AI-ready text from any YouTube video in seconds.
AI-Ready Text (`transcript`)
A beautifully concatenated, single string of text — perfect for feeding directly into ChatGPT, Claude, or your custom RAG pipelines without breaking tokenizers.
JSON Array (`structured_transcript`)
A clean JSON array containing individual text blocks and timestamps, ideal if you need to build custom video players or subtitle viewers.
All requests to this API require your unique RapidAPI Key. You do not need to manage rotating session tokens yourself.
Just ensure these headers are included in every HTTP request:
X-RapidAPI-Key: YOUR_RAPIDAPI_KEYX-RapidAPI-Host: youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript EndpointThis single endpoint handles everything. You can pass either a clean Video ID or just dump a messy YouTube URL into the request.
| Name | Type | In | Description |
|---|---|---|---|
videoId | string | Query | Optional*. The 11-character YouTube ID (e.g., dQw4w9WgXcQ). |
url | string | Query | Optional*. Any valid YouTube URL (e.g., https://youtu.be/dQw4w9WgXcQ?t=43). |
lang | string | Query | Optional. The language code. Defaults to en. Use vi for Vietnamese or other ISO codes. |
(Note: You must provide EITHER videoId OR url).
Leverage the API in any environment. Below are standard snippets to get you started quickly:
curl --request GET \ --url 'https://youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript?videoId=dQw4w9WgXcQ&lang=en' \ --header 'X-RapidAPI-Host: youtube-video-transcript-subtitles-pro.p.rapidapi.com' \ --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY'import requests
url = "https://youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript"querystring = {"videoId": "dQw4w9WgXcQ", "lang": "en"}
headers = { "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY", "X-RapidAPI-Host": "youtube-video-transcript-subtitles-pro.p.rapidapi.com"}
response = requests.get(url, headers=headers, params=querystring)data = response.json()
print(data.get("transcript"))const axios = require('axios');
const options = { method: 'GET', url: 'https://youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript', params: { videoId: 'dQw4w9WgXcQ', lang: 'en' }, headers: { 'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY', 'X-RapidAPI-Host': 'youtube-video-transcript-subtitles-pro.p.rapidapi.com' }};
try { const response = await axios.request(options); console.log(response.data.transcript);} catch (error) { console.error(error);}<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript?videoId=dQw4w9WgXcQ&lang=en", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "X-RapidAPI-Host: youtube-video-transcript-subtitles-pro.p.rapidapi.com", "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" ],]);
$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}You can easily plug this API into your favorite automation platforms seamlessly.
GET.https://youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript.None (we’ll use headers).X-RapidAPI-Key | Value: YOUR_RAPIDAPI_KEYX-RapidAPI-Host | Value: youtube-video-transcript-subtitles-pro.p.rapidapi.comvideoId | Value: dQw4w9WgXcQ (or map it dynamically from a previous node)https://youtube-video-transcript-subtitles-pro.p.rapidapi.com/transcript.X-RapidAPI-Key | Value: YOUR_RAPIDAPI_KEYX-RapidAPI-Host | Value: youtube-video-transcript-subtitles-pro.p.rapidapi.comvideoId and lang with your desired values.Yes.transcript variable to downstream apps!| Status Code | Description | Solution |
|---|---|---|
200 | Success | Data retrieved successfully. |
400 | Bad Request | Invalid url or videoId. |
404 | Not Found | The video does not exist, is private, or has subtitles disabled. |
429 | Too Many Requests | Rate limit exceeded. |
500 | Server Error | YouTube change detected. Try again later. |