youtube-analytics
YouTube Data API v3 analytics toolkit. Analyze YouTube channels, videos, and search results. Use when the user asks to: check YouTube channel stats, analyze video performance, compare channels, search for videos, get subscriber counts, view engagement metrics, find trending videos, get channel uploads, or analyze YouTube competition. Requires a YouTube Data API v3 key from Google Cloud Console.
Best use case
youtube-analytics is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
YouTube Data API v3 analytics toolkit. Analyze YouTube channels, videos, and search results. Use when the user asks to: check YouTube channel stats, analyze video performance, compare channels, search for videos, get subscriber counts, view engagement metrics, find trending videos, get channel uploads, or analyze YouTube competition. Requires a YouTube Data API v3 key from Google Cloud Console.
Teams using youtube-analytics should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/youtube-analytics/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How youtube-analytics Compares
| Feature / Agent | youtube-analytics | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
YouTube Data API v3 analytics toolkit. Analyze YouTube channels, videos, and search results. Use when the user asks to: check YouTube channel stats, analyze video performance, compare channels, search for videos, get subscriber counts, view engagement metrics, find trending videos, get channel uploads, or analyze YouTube competition. Requires a YouTube Data API v3 key from Google Cloud Console.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agent for YouTube Script Writing
Find AI agent skills for YouTube script writing, video research, content outlining, and repeatable channel production workflows.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# YouTube Analytics Toolkit
## Setup
Install dependencies:
```bash
cd scripts && npm install
```
Configure credentials by creating a `.env` file in the project root:
```
YOUTUBE_API_KEY=AIzaSy...your-api-key
YOUTUBE_DEFAULT_MAX_RESULTS=50
```
**Prerequisites**: A Google Cloud project with the YouTube Data API v3 enabled. Get your API key from the [Google Cloud Console](https://console.cloud.google.com/apis/credentials).
## Quick Start
| User says | Function to call |
|-----------|-----------------|
| "Analyze this YouTube channel" | `analyzeChannel(channelId)` |
| "Compare these two channels" | `compareChannels([id1, id2])` |
| "How is this video performing?" | `analyzeVideo(videoId)` |
| "Search YouTube for [topic]" | `searchAndAnalyze(query)` |
| "Get stats for this channel" | `getChannelStats(channelId)` |
| "Get this video's view count" | `getVideoStats(videoId)` |
| "Find channels about [topic]" | `searchChannels(query)` |
| "Show recent uploads from this channel" | `getChannelVideos(channelId)` |
Execute functions by importing from `scripts/src/index.ts`:
```typescript
import { analyzeChannel, searchAndAnalyze } from './scripts/src/index.js';
const analysis = await analyzeChannel('UCxxxxxxxx');
```
Or run directly with tsx:
```bash
npx tsx scripts/src/index.ts
```
## Workflow Pattern
Every analysis follows three phases:
### 1. Analyze
Run API functions. Each call hits the YouTube Data API and returns structured data.
### 2. Auto-Save
All results automatically save as JSON files to `results/{category}/`. File naming patterns:
- Named results: `{sanitized_name}.json`
- Auto-generated: `YYYYMMDD_HHMMSS__{operation}.json`
### 3. Summarize
After analysis, read the saved JSON files and create a markdown summary in `results/summaries/` with data tables, comparisons, and insights.
## High-Level Functions
| Function | Purpose | What it gathers |
|----------|---------|----------------|
| `analyzeChannel(channelId)` | Full channel analysis | Channel info, recent videos, avg views per video |
| `compareChannels(channelIds)` | Compare multiple channels | Side-by-side subscribers, views, video counts |
| `analyzeVideo(videoId)` | Video performance analysis | Views, likes, comments, like rate, comment rate |
| `searchAndAnalyze(query, maxResults?)` | Search + stats | Search results with full video statistics |
## Individual API Functions
For granular control, import specific functions from the API modules. See [references/api-reference.md](references/api-reference.md) for the complete list of 13 API functions with parameters, types, and examples.
### Channel Functions
| Function | Purpose |
|----------|---------|
| `getChannel(channelId)` | Get full channel details |
| `getChannelStats(channelId)` | Get simplified stats (subscribers, views, videoCount) |
| `getMultipleChannels(channelIds)` | Batch fetch multiple channels |
### Video Functions
| Function | Purpose |
|----------|---------|
| `getVideo(videoId)` | Get full video details |
| `getVideoStats(videoId)` | Get simplified stats (views, likes, comments) |
| `getMultipleVideos(videoIds)` | Batch fetch multiple videos |
| `getChannelVideos(channelId)` | Get recent uploads from a channel |
### Search Functions
| Function | Purpose |
|----------|---------|
| `searchVideos(query, options?)` | Search for videos |
| `searchChannels(query, options?)` | Search for channels |
## Results Storage
Results auto-save to `results/` with this structure:
```
results/
├── channels/ # Channel data and comparisons
├── videos/ # Video data and analyses
├── search/ # Search results
└── summaries/ # Human-readable markdown summaries
```
### Managing Results
```typescript
import { listResults, loadResult, getLatestResult } from './scripts/src/index.js';
// List recent results
const files = listResults('channels', 10);
// Load a specific result
const data = loadResult(files[0]);
// Get most recent result for an operation
const latest = getLatestResult('channels', 'channel_analysis');
```
## Tips
1. **Use channel IDs** — Channel IDs start with `UC` (e.g., `UCxxxxxxxx`). You can find them in the channel URL or page source.
2. **Request summaries** — After pulling data, ask for a markdown summary with tables and insights.
3. **Compare channels** — Use `compareChannels()` to benchmark competitors side by side.
4. **Batch requests** — Use `getMultipleChannels()` or `getMultipleVideos()` for efficient batch lookups.
5. **Search + analyze** — `searchAndAnalyze()` combines search with full video stats in one call.Related Skills
oura-analytics
Oura Ring data integration and analytics. Fetch sleep scores, readiness, activity, HRV, and trends from the Oura Cloud API. Generate automated reports, correlations with productivity, and trigger-based alerts for low recovery days. Requires OURA_API_TOKEN (get at cloud.ouraring.com).
fitbit-analytics
Fitbit health and fitness data integration. Fetch steps, heart rate, sleep, activity, calories, and trends from Fitbit Web API. Generate automated health reports and alerts. Requires FITBIT_CLIENT_ID, FITBIT_CLIENT_SECRET, FITBIT_ACCESS_TOKEN, FITBIT_REFRESH_TOKEN.
youtube-video-downloader
Download YouTube videos in various formats and qualities. Use when you need to save videos for offline viewing, extract audio, download playlists, or get specific video formats.
youtube-thumbnail-grabber
Download YouTube video thumbnails in various resolutions. Use when you need to get video preview images, create collages, or save thumbnails for reference.
youtube-summarize
Summarize YouTube videos by extracting transcripts and captions. Use when you need to get a quick summary of a video, extract key points, or analyze video content without watching it.
youtube-editor
Automate YouTube video editing workflow: Download -> Transcribe (Whisper) -> Analyze (GPT-4) -> High-Quality.
remove-analytics
Safely remove Google Analytics from a project. Cleans up all tracking code, dependencies, and environment variables.
check-analytics
Audit existing Google Analytics implementation. Checks for common issues, missing configurations, and optimization opportunities.
add-analytics
Add Google Analytics 4 tracking to any project. Detects framework, adds tracking code, sets up events, and configures privacy settings.
analytics-tracking
When the user wants to set up, improve, or audit analytics tracking and measurement.
worthclip-youtube-video-scorer
AI-powered YouTube video scoring.
youtube-apify-transcript
Fetch YouTube transcripts via APIFY API (works from cloud IPs, bypasses YouTube bot detection).