Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Youtube Api Project

FreeNot checked

This repo is focused on helping creators analyze and improve their YouTube channels

GitHubEmbed

About

This repo is focused on helping creators analyze and improve their YouTube channels

README

A reliable YouTube content extraction server using Google Data API v3 for dramatically improved reliability over yt-dlp based solutions.

🎯 100% Function Success Rate - Production Ready!

Tested and verified with real YouTube content:

  • ✅ Video information extraction with engagement metrics (11.44% engagement rate)
  • ✅ Comment extraction with threading (3+ comments per video)
  • ✅ YouTube search functionality (Python programming tutorials)
  • ✅ Channel information and statistics (Du'An Lightfoot channel)
  • ✅ Video engagement analysis with industry benchmarks (Excellent tier)
  • ✅ Transcript extraction (271 segments, 884 seconds)
  • ✅ Transcript search capabilities (keyword matching)
  • Playlist information extraction ("Certifications" playlist, 8 videos)
  • ✅ Health monitoring and statistics (100% uptime)

Key Improvements Over yt-dlp

Feature yt-dlp YouTube API v3 Improvement
Success Rate ~30-70% 100% +30-70%
Video Info Unreliable Always works Consistent data
Comments ~20% success Reliable threading 5x better
Search Not supported Native API New capability
Speed 15-30 seconds 1-3 seconds 10x faster
Engagement Basic stats Rich metrics Industry benchmarks

Features

  • 100% Reliability: Uses official YouTube Data API v3 instead of scraping
  • Comprehensive Data: Video info, channel data, comments, search, playlists
  • Smart Rate Limiting: Respects API quotas with intelligent caching
  • Rich Engagement Metrics: Calculate engagement rates with industry benchmarks
  • Hybrid Transcripts: Falls back to yt-dlp only for transcript extraction
  • Full MCP Integration: 15 tools ready for Claude Desktop
  • Production Testing: Verified with real content and edge cases

Quick Start

  1. Get YouTube Data API Key:

  2. Install:

    uv sync  # or pip install -e .
    
  3. Configure:

    cp .env.example .env
    # Edit .env and add: YOUTUBE_API_KEY=your_api_key_here
    
  4. Test:

    uv run python examples/basic_usage.py
    
  5. Run MCP Server:

    # Via entry point script (recommended)
    uv run python server.py
    
    # Via installed package
    uv run youtube-api-mcp-server
    
    # For MCP Inspector testing
    npx @modelcontextprotocol/inspector uv --directory ./ run server.py
    

Verified MCP Tools (15 total)

get_video_info - Extract video metadata with engagement metrics
get_video_comments - Reliable comment extraction with threading
get_video_comments_batch - Extract large numbers of comments
search_youtube - Native YouTube search functionality
get_channel_info - Complete channel statistics and data
analyze_video_engagement - Industry benchmark analysis
get_video_transcript - Transcript extraction via yt-dlp fallback
search_transcript - Search within video transcripts
get_playlist_info - Playlist details and video lists
get_trending_videos - Regional trending content
batch_extract_urls - Concurrent processing of multiple URLs
get_extractor_health - Health monitoring and diagnostics
clear_extractor_cache - Cache management
get_extractor_config - Configuration inspection

API Quota Usage

  • Free Tier: 10,000 units/day
  • Video Info: 1 unit per request
  • Comments: ~1 unit per comment thread
  • Search: 100 units per request
  • Typical Usage: ~101 units per full video analysis
  • Daily Capacity: ~99 complete video analyses

MCP Server Configuration

Claude Code Setup

Configure the YouTube MCP server with Claude Code:

# Basic configuration (local scope - default)
claude mcp add youtube-api --env YOUTUBE_API_KEY=your_api_key_here \
  -- uv --directory /path/to/youtube-api-project run python server.py

# User scope - available across all your projects
claude mcp add youtube-api --scope user \
  --env YOUTUBE_API_KEY=your_api_key_here \
  -- uv --directory /path/to/youtube-api-project run python server.py

# With additional environment variables
claude mcp add youtube-api --scope user \
  --env YOUTUBE_API_KEY=your_api_key_here \
  --env YOUTUBE_CACHE_TTL=7200 \
  --env YOUTUBE_LOG_LEVEL=DEBUG \
  -- uv --directory /path/to/youtube-api-project run python server.py

# For team sharing (creates .mcp.json file)
claude mcp add youtube-api --scope project \
  --env YOUTUBE_API_KEY=your_api_key_here \
  -- uv --directory /path/to/youtube-api-project run python server.py

Scope Options:

  • --scope local (default): Only you, current project only
  • --scope user: Available to you across all projects (recommended)
  • --scope project: Shared with team via .mcp.json file

Manage your server:

claude mcp list              # List all configured servers
claude mcp get youtube-api    # Check server details
claude mcp remove youtube-api # Remove server

Within Claude Code:

/mcp                         # Check server status
@youtube-api:                # Reference MCP resources (if supported)

Claude Desktop Setup

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "youtube-api": {
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/path/to/youtube-api-project",
      "env": {
        "YOUTUBE_API_KEY": "your_youtube_api_key_here"
      }
    }
  }
}

Environment Variables

All environment variables use the YOUTUBE_ prefix:

Required:

  • YOUTUBE_API_KEY - Your YouTube Data API v3 key

Optional Configuration:

# API Configuration
YOUTUBE_API_VERSION=v3                           # Default: v3
YOUTUBE_MY_CHANNEL_ID=your_channel_id           # For private data
YOUTUBE_MY_UPLOADED_VIDEO_PLAYLIST_ID=playlist  # Your uploads playlist

# Rate Limiting
YOUTUBE_DAILY_QUOTA_LIMIT=10000                  # Default: 10000
YOUTUBE_REQUESTS_PER_SECOND=10.0                 # Default: 10.0

# Caching
YOUTUBE_CACHE_ENABLED=true                       # Default: true
YOUTUBE_CACHE_TTL=3600                          # Default: 3600 seconds
YOUTUBE_CACHE_MAX_SIZE=1000                     # Default: 1000 entries

# Fallback & Logging
YOUTUBE_ENABLE_YTDLP_FALLBACK=true              # Default: true
YOUTUBE_YTDLP_RATE_LIMIT=500K                   # Default: 500K
YOUTUBE_LOG_LEVEL=INFO                          # Default: INFO

Advanced Claude Desktop Config:

{
  "mcpServers": {
    "youtube-api": {
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/path/to/youtube-api-project",
      "env": {
        "YOUTUBE_API_KEY": "your_api_key_here",
        "YOUTUBE_CACHE_TTL": "7200",
        "YOUTUBE_LOG_LEVEL": "DEBUG",
        "YOUTUBE_REQUESTS_PER_SECOND": "5.0"
      }
    }
  }
}

Alternative Entry Points

# Direct script execution
uv run python server.py

# Installed package command
uv run youtube-api-mcp-server

# With environment variables
YOUTUBE_API_KEY=your_key uv run python server.py

Testing Results

Latest Test Results (verified with real content):

  • ✅ Video: "10 Reasons You Are Not Successful in Your I.T. Career"
  • ✅ Channel: Du'An Lightfoot analysis
  • ✅ Comments: 3+ extracted with threading
  • ✅ Engagement: 11.44% (Excellent tier)
  • ✅ Transcript: 271 segments, 884 seconds
  • Playlist: "Certifications" with 8 videos successfully extracted
  • Function Success Rate: 100% (9/9 functions working)
  • ✅ API Usage: Efficient quota management

Migration from yt-dlp

This server provides the same MCP interface as yt-dlp based servers but with dramatically higher reliability.

Migration Benefits:

  • Reliability: 30-70% → 100% success rate
  • Speed: 15-30s → 1-3s response times
  • Data Quality: Inconsistent → Structured, comprehensive
  • New Features: Engagement analysis, proper search, comment threading, playlist support

See MIGRATION_GUIDE.md for detailed migration instructions and comparison.

Examples

Run the examples to see all features in action:

uv run python examples/basic_usage.py      # Test all major functions
uv run python examples/api_setup_guide.py  # Validate API setup
uv run python examples/comparison_demo.py  # See reliability improvements

from github.com/labeveryday/youtube-api-project

Installing Youtube Api Project

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/labeveryday/youtube-api-project

FAQ

Is Youtube Api Project MCP free?

Yes, Youtube Api Project MCP is free — one-click install via Unyly at no cost.

Does Youtube Api Project need an API key?

No, Youtube Api Project runs without API keys or environment variables.

Is Youtube Api Project hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Youtube Api Project in Claude Desktop, Claude Code or Cursor?

Open Youtube Api Project on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Youtube Api Project with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All media MCPs