Build powerful YouTube transcript pipelines with Node.js. Our API integrates seamlessly with Express, Fastify, and serverless platforms like Vercel and AWS Lambda. Process transcripts for chatbots, content management systems, or data pipelines with minimal code.
npm install node-fetchimport fetch from "node-fetch";
const API_KEY = process.env.YT_TRANSCRIPTS_API_KEY;
async function getTranscript(videoUrl) {
const res = await fetch(
`https://api.youtubetranscripts.co/v1/transcript?url=${encodeURIComponent(videoUrl)}`,
{ headers: { "x-api-key": API_KEY } }
);
if (!res.ok) {
throw new Error(`API error: ${res.status} ${res.statusText}`);
}
return res.json();
}
// Usage
const data = await getTranscript("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
console.log(`Title: ${data.title}`);
console.log(`Segments: ${data.transcript.length}`);
// Get plain text
const fullText = data.transcript.map((s) => s.text).join(" ");
console.log(fullText);Native ESM and CommonJS support
Works with Express, Fastify, Hono, and Koa
Deploy on Vercel, AWS Lambda, Cloudflare Workers
Stream-friendly JSON responses for large transcripts
Batch API for processing video playlists
TypeScript type definitions available
Sign up in 30 seconds. Get 150 free API requests. No credit card required. Your Node.js integration can be live in minutes.