Skip to main content

YouTube transcripts

This covers how to load youtube transcript into LangChain documents.


You'll need to install the youtube-transcript package and youtubei.js to extract metadata:

npm install youtube-transcript youtubei.js


You need to specify a link to the video in the url. You can also specify language in ISO 639-1 and addVideoInfo flag.

import { YoutubeLoader } from "langchain/document_loaders/web/youtube";

const loader = YoutubeLoader.createFromUrl("", {
language: "en",
addVideoInfo: true,

const docs = await loader.load();


API Reference:

Help us out by providing feedback on this documentation page: