Official Node.js SDK

YouTube transcripts in Node.js

The @tubeagentkit/getyoutubetranscript package is a typed client for the REST API. It works the same on a laptop, a VPS, a serverless function or a CI job, since transcripts are fetched on the API's servers rather than yours.

Set it up

  1. 1

    Install

    With npm (ESM and CommonJS builds included):

    npm install @tubeagentkit/getyoutubetranscript
  2. 2

    Get an API key

    Sign in at getyoutubetranscript.com and create a key on the developers page (100 free credits, no card). Keys start with sk_live_.

Get a transcript

import { GetYouTubeTranscript } from "@tubeagentkit/getyoutubetranscript";

const client = new GetYouTubeTranscript({ apiKey: process.env.GYT_API_KEY! });

const { title, transcript, word_count } = await client.getTranscript({
  v: "https://www.youtube.com/watch?v=jNQXAC9IVRw",
});

console.log(title, word_count, transcript.slice(0, 200));

What you can do

  • Pass timestamps: true to get a segments array with start and duration per caption line.
  • Search YouTube and list channel or playlist videos with continuation tokens.
  • Use it from API routes and cron jobs without proxies.

Links

Questions about Node.js

Is it typed?

Yes. The package ships TypeScript declarations for every method and response.

What does it cost?

Each transcript, search or channel page uses one credit from your account, and failed requests are not charged. New accounts get 100 free credits, no card, and paid plans add more credits each month.

Use it in your other tools

All integrations