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
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
Real data. Real impact.
Growing
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
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.
| 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
Every analysis follows three phases:
Run API functions. Each call hits the YouTube Data API and returns structured data.
All results automatically save as JSON files to
results/{category}/. File naming patterns:
{sanitized_name}.jsonYYYYMMDD_HHMMSS__{operation}.jsonAfter analysis, read the saved JSON files and create a markdown summary in
results/summaries/ with data tables, comparisons, and insights.
| 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 |
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.
| Function | Purpose |
|---|---|
| Get full channel details |
| Get simplified stats (subscribers, views, videoCount) |
| Batch fetch multiple channels |
| Function | Purpose |
|---|---|
| Get full video details |
| Get simplified stats (views, likes, comments) |
| Batch fetch multiple videos |
| Get recent uploads from a channel |
| Function | Purpose |
|---|---|
| Search for videos |
| Search for channels |
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
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');
UC (e.g., UCxxxxxxxx). You can find them in the channel URL or page source.compareChannels() to benchmark competitors side by side.getMultipleChannels() or getMultipleVideos() for efficient batch lookups.searchAndAnalyze() combines search with full video stats in one call.No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.