YTAPI.devDocs
Agent resources

AI Agent Setup & Tooling

How AI coding agents, LLMs, and autonomous tools can consume YouTube Transcript API documentation and execute data extraction tasks.

Last updated Sep 13, 2026
||MarkdownView as Markdown|Agent setup

The YouTube Transcript & Data API is designed AI-native from the ground up. Autonomous agents, LLMs, and IDE assistants can read clean markdown schemas, query machine-readable indexes, and execute tools via the Model Context Protocol (MCP).


Machine-Readable Endpoints

For LLMs and agents that need to fetch documentation into context windows without parsing heavy HTML:

ResourceURLDescription
LLMs Indexhttps://docs.ytapi.dev/llms.txtSpec-compliant manifest of all documentation pages with short descriptions.
Full LLMs Dumphttps://docs.ytapi.dev/llms-full.txtSingle concatenated Markdown document containing the entire platform documentation.
Raw Page MDXhttps://docs.ytapi.dev/{slug}.mdxAppend .mdx to any documentation URL to retrieve raw, clean Markdown.

Agent Quick Fetch

In bash-based agents (e.g. Claude Code, Codex, Aider), fetch the entire API reference with:

curl -s https://docs.ytapi.dev/llms-full.txt

Model Context Protocol (MCP)

Connect your AI assistants directly to the YouTube Transcript API using the Model Context Protocol (MCP).

Claude Desktop & Cursor Configuration

Add the following to your MCP client configuration (claude_desktop_config.json or .cursor/mcp.json):

{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": ["-y", "@ytapi/mcp-server"],
      "env": {
        "YT_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Available MCP Tools

Tool NameParametersDescription
get_transcriptvideo_id, format, languagesFetch transcript in markdown, srt, vtt, or word_timestamps.
get_video_infovideo_id, mode (fast / full)Fetch metadata, author, view counts, and chapter boundaries.
search_youtubequery, type, limitFull-text video and channel search without consuming Google Cloud quota.
get_commentsvideo_id, sort_by, limitRetrieve top or recent comment threads with engagement metrics.

Code Mode & Function Calling

When orchestrating extraction pipelines via OpenAI, Anthropic, or Gemini tool calling, provide the JSON Schema directly:

{
  "name": "fetch_youtube_transcript",
  "description": "Extract subtitles or transcripts from any YouTube video in structured Markdown or SRT.",
  "parameters": {
    "type": "object",
    "properties": {
      "video_id": {
        "type": "string",
        "description": "11-character YouTube video ID or full URL"
      },
      "format": {
        "type": "string",
        "enum": ["markdown", "text", "srt", "vtt", "word_timestamps"],
        "default": "markdown"
      }
    },
    "required": ["video_id"]
  }
}

Platform Skills & System Prompts

Cursor Rules (.cursorrules)

Add this prompt rule to your project to instruct Cursor on how to query YouTube transcripts:

# YouTube Transcript API Guidelines

When writing code that extracts YouTube subtitles or transcripts:
1. Always use `https://api.ytapi.dev/v1/transcripts` with `Authorization: Bearer $YT_API_KEY`.
2. For LLM summaries or context injection, specify `"format": "markdown"`.
3. For video subtitle synchronizing, specify `"format": "word_timestamps"` with `"word_level": true`.
4. Check `X-Cache` response headers (`HIT` or `MISS`) to measure latency.
5. Refer to complete documentation at `https://docs.ytapi.dev/llms.txt`.

On this page