Skills 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.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/adamkristopher/youtube-analytics" ~/.claude/skills/clawdbot-skills-youtube-analytics && rm -rf "$T"
skills/adamkristopher/youtube-analytics/SKILL.mdYouTube Analytics Toolkit
Setup
Install dependencies:
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.
Quick Start
| User says | Function to call |
|---|---|
| "Analyze this YouTube channel" | |
| "Compare these two channels" | |
| "How is this video performing?" | |
| "Search YouTube for [topic]" | |
| "Get stats for this channel" | |
| "Get this video's view count" | |
| "Find channels about [topic]" | |
| "Show recent uploads from this channel" | |
Execute functions by importing from
scripts/src/index.ts:
import { analyzeChannel, searchAndAnalyze } from './scripts/src/index.js'; const analysis = await analyzeChannel('UCxxxxxxxx');
Or run directly with tsx:
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 |
|---|---|---|
| Full channel analysis | Channel info, recent videos, avg views per video |
| Compare multiple channels | Side-by-side subscribers, views, video counts |
| Video performance analysis | Views, likes, comments, like rate, comment rate |
| 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 for the complete list of 13 API functions with parameters, types, and examples.
Channel Functions
| Function | Purpose |
|---|---|
| Get full channel details |
| Get simplified stats (subscribers, views, videoCount) |
| Batch fetch multiple channels |
Video Functions
| Function | Purpose |
|---|---|
| Get full video details |
| Get simplified stats (views, likes, comments) |
| Batch fetch multiple videos |
| Get recent uploads from a channel |
Search Functions
| Function | Purpose |
|---|---|
| Search for videos |
| 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
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
- Use channel IDs — Channel IDs start with
(e.g.,UC
). You can find them in the channel URL or page source.UCxxxxxxxx - Request summaries — After pulling data, ask for a markdown summary with tables and insights.
- Compare channels — Use
to benchmark competitors side by side.compareChannels() - Batch requests — Use
orgetMultipleChannels()
for efficient batch lookups.getMultipleVideos() - Search + analyze —
combines search with full video stats in one call.searchAndAnalyze()