LangChain YouTube Transcript Loader & Tools

Load YouTube transcripts as LangChain Documents, and give agents tools to get a transcript, summarize a video, or search YouTube.

Python package

pip install -U langchain-easytranscriber

PyPI · Source on GitHub

Overview

EasyTranscriber turns YouTube videos into transcripts and AI summaries through a REST API. Transcripts come from the video's captions, or from speech-to-text when a video has none, for videos up to 4 hours. Summaries are Markdown, in 65 languages.

langchain-easytranscriber gives you three tools, a toolkit and a document loader. They are Python only, and not serializable.

The langchain-easytranscriber components and their credit costs
ComponentInputReturnsCredits
EasyTranscriberTranscriptToolurltitle, URL, transcript0 if cached, else 1 (2 over 2 hours)
EasyTranscriberSummaryToolurl, optional languagetitle, URL, Markdown summarytranscript cost + 1
EasyTranscriberSearchToolqueryup to 10 videos1
EasyTranscriberLoaderlist of URLsone Document per videoas above

EasyTranscriberToolkit bundles the three tools with one API key. Invoked with a ToolCall, each tool returns a ToolMessage whose artifact holds the API response, including credits_used. For EasyTranscriberSummaryTool it is one dict for both calls: video_id, video_title, summary, cached_transcript and credits_used (transcript plus summary).

Setup

Credentials

Create a free account at easytranscriber.com and an API key in Dashboard → API Keys. Signup includes 5 credits, and 1 credit is added each day while the balance is below 5. API access is included on every plan, Free included. Plans and prices: pricing.

import getpass
import os

if not os.environ.get("EASYTRANSCRIBER_API_KEY"):
    os.environ["EASYTRANSCRIBER_API_KEY"] = getpass.getpass("EasyTranscriber API key:\n")

Installation

pip install -U langchain-easytranscriber
# or
uv add langchain-easytranscriber

Instantiation

from langchain_easytranscriber import (
    EasyTranscriberSearchTool,
    EasyTranscriberSummaryTool,
    EasyTranscriberTranscriptTool,
)

transcript_tool = EasyTranscriberTranscriptTool()
summary_tool = EasyTranscriberSummaryTool()
search_tool = EasyTranscriberSearchTool()

Every class also accepts api_key="et_...", timeout (seconds, default 310) and max_retries (retries after HTTP 429, default 2).

Invocation

Directly

transcript_tool.invoke({"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"})
summary_tool.invoke({"url": "https://youtu.be/dQw4w9WgXcQ", "language": "Spanish"})
search_tool.invoke({"query": "python asyncio tutorial"})

url accepts youtube.com/watch?v=, youtu.be/, /shorts/ and /embed/ links. language is an English display name such as English, Spanish or Japanese; omit it to match the video's language.

As a ToolCall

# This is usually generated by a model, but we'll create a tool call directly for demo purposes.
model_generated_tool_call = {
    "args": {"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"},
    "id": "1",
    "name": transcript_tool.name,
    "type": "tool_call",
}
message = transcript_tool.invoke(model_generated_tool_call)
message.artifact["cached"], message.artifact["credits_used"]

Within an agent

# pip install -qU "langchain[anthropic]" to call the model
from langchain.agents import create_agent
from langchain_easytranscriber import EasyTranscriberToolkit

agent = create_agent(
    model="anthropic:claude-sonnet-5-5",
    tools=EasyTranscriberToolkit().get_tools(),
)

agent.invoke(
    {"messages": [{"role": "user", "content": "Find a recent talk on Python asyncio and summarize it."}]}
)

Document loader

from langchain_easytranscriber import EasyTranscriberLoader

loader = EasyTranscriberLoader(
    ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://youtu.be/9bZkp7q19f0"],
    include_summary=True,        # adds metadata["summary"], 1 credit per video
    summary_language="English",
    continue_on_failure=True,    # log and skip videos that fail
)

docs = loader.load()             # or: for doc in loader.lazy_load(), or: await loader.aload()
docs[0].metadata
# {'source': 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'video_id': 'dQw4w9WgXcQ',
#  'title': '...', 'method': 'yt-dlp', 'cached': False, 'credits_used': 2, 'summary': '## ...'}

page_content is the transcript text. method is yt-dlp or innertube for captions and deepgram for speech-to-text. cached is True when the transcript was served from cache at 0 credits.

Errors

API errors raise ToolException from tools (for example insufficient_credits (402), unauthorized (401), rate_limited (429)), and so do timeouts and connection errors. Pass handle_tool_error=True to return the message to the agent instead.

The loader raises easytranscriber_sdk.APIError for an API error, easytranscriber_sdk.APIResponseError for a response that is not a JSON object, or the httpx error for a timeout or connection failure, unless continue_on_failure=True, which logs and skips that video.

API reference

EasyTranscriber is not affiliated with YouTube or Google.