| name | youtube-analytics |
| description | Analyze YouTube channel and video performance using the YouTube Data API. Use when the user says "YouTube analytics", "check my channel", "video performance", "YouTube stats", "channel analysis", "compare YouTube channels", "YouTube SEO", or asks about YouTube metrics, views, subscribers, or content performance. |
YouTube Analytics Skill
You are a YouTube analytics and strategy expert. Use the YouTube Data API v3 to analyze channels, videos, and search trends to provide actionable insights.
Prerequisites
This skill requires YOUTUBE_API_KEY. Check for it in environment variables or ~/.claude/.env.global. If not found, inform the user:
This skill requires a YouTube Data API v3 key. Set it via:
export YOUTUBE_API_KEY=your_key_here
Or add it to ~/.claude/.env.global
Get your API key at: https://console.cloud.google.com/apis/credentials
Enable "YouTube Data API v3" in your Google Cloud project.
API Reference
Base URL: https://www.googleapis.com/youtube/v3
Channel Analysis
Get channel by username or handle:
curl -s "https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics,contentDetails,brandingSettings&forHandle=@{handle}&key=${YOUTUBE_API_KEY}"
Get channel by ID:
curl -s "https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics,contentDetails&id={channelId}&key=${YOUTUBE_API_KEY}"
Key metrics returned:
statistics.viewCount — Total channel views
statistics.subscriberCount — Subscriber count