NODE API EXAMPLE
YouTube Transcript API Node.js
Call the TubeScript transcript endpoint from Node.js, Next.js, workers, or backend jobs using fetch.
QUICK ANSWERS
Direct answer
The real endpoint is https://tubescript.cc/v1/transcript. API access is included with the Team plan.
01
YouTube Transcript API Node.js
Node apps can call the TubeScript API with fetch. POST a YouTube URL to https://tubescript.cc/v1/transcript and include an Authorization bearer token from a Team account.
Node.js
const response = await fetch("https://tubescript.cc/v1/transcript", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://youtube.com/watch?v=dQw4w9WgXcQ",
language: "en",
stream: false,
}),
});
const payload = await response.json();
if (!payload.success) {
throw new Error(`${payload.error.code}: ${payload.error.message}`);
}
console.log(payload.data.transcript_source);
console.log(payload.data.segments.map((segment) => segment.text).join(" "));Works in server code
Keep API keys on the server. Do not expose Team bearer tokens in browser JavaScript.
Streaming is optional
Set stream to true only when your app is ready to parse Server-Sent Events. JSON mode is simpler for batch-like jobs.
Build on the transcript engine
Team includes API keys, JSON transcript access, cache-backed reads, and 100 API requests per day.
View Pricing