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.
Best AI Agents for Marketing
A curated list of the best AI agents and skills for marketing teams focused on SEO, content systems, outreach, and campaign execution.
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
openclaw-youtube
YouTube SERP Scout for agents. Search top-ranking videos, channels, and trends for content research and competitor tracking.
marketing-analytics
Analyze marketing campaign data to generate performance reports and optimization recommendations
youtube-search
YouTube Search API via AIsa unified endpoint. Search YouTube videos, channels, and playlists with a single AIsa API key — no Google API key or OAuth required. Use this skill when users want to search YouTube content. For other AIsa capabilities (LLM, financial data, Twitter, web search), see the aisa-core skill.
datafast-analytics
Query DataFast website analytics and visitor data via the DataFast API for metrics, time series, realtime stats, breakdowns, visitor details, and goal/payment management.
youtube-archiver
Archive YouTube playlists into markdown notes with metadata, transcripts, AI summaries, and tags. Use when a user asks to import/sync YouTube playlists, archive Watch Later or Liked videos, enrich YouTube notes, batch process video notes, or automate recurring YouTube-to-markdown sync jobs with cron.
youtube-digest
Understand, summarize, translate, and extract key points from YouTube videos. Use when a user provides a YouTube URL and wants: (1) a Chinese summary, (2) a transcript or subtitle extraction, (3) translation of spoken content, (4) timestamps / chapter notes, (5) visual understanding via key frames, or (6) question answering about a video. Prefer this skill for transcript-first workflows.
youtube-content-manager
YouTube内容管理后台,支持AI选题生成、脚本创作、标题优化、SEO描述生成、缩略图文案建议、发布记录管理和数据分析。集成SkillPay支付接口,每次调用收0.001USDT。
youtube-content-manager-pro
All-in-one YouTube Content Management Tool, AI generate topics, scripts, titles, SEO descriptions, tags, thumbnails, analytics. $0.005 USDT per use.
youtube-audio-download
Download YouTube video audio and convert to MP3. Supports age-restricted videos with cookies.
banner-youtube-translate-workflow
Complete workflow: download YouTube audio, launch Doubao, play audio, capture translation. Activates when user needs full video translation.
pipeline-analytics
Generate interactive analytics dashboards from CRM data. Use when asked to "show pipeline stats", "create a report", "analyze leads", "show conversion rates", "build a dashboard", "visualize outreach data", "funnel analysis", or any data visualization request from DuckDB workspace data.
YouTube Channel Scraper
A browser-based YouTube channel discovery and scraping tool.