Skip to content

roiizchak/YouTube-Analytics

Repository files navigation

YouTube Analytics

Automated intelligence pipeline that monitors the AI/automation niche on YouTube, surfaces trends and competitor insights, and delivers a professional slide deck report.

What It Does

  1. Collect — Searches 14 queries via YouTube Data API v3, deduplicates, fetches video details and channel stats
  2. Analyze — Extracts trends, calculates engagement benchmarks, ranks competitors, detects content gaps
  3. AI Insights (optional) — Generates video summaries, title hook patterns, and thumbnail analysis via Gemini
  4. Report — Builds a 12–15 slide PPTX deck (Deep Purple + Emerald design)
  5. Deliver — Sends styled HTML email with the PPTX attached

Setup

npm install

Create a .env file:

YOUTUBE_API_KEY=your_key
REPORT_EMAIL=recipient@example.com
GMAIL_USER=your_gmail@gmail.com
GMAIL_APP_PASSWORD=your_app_password
GEMINI_API_KEY=your_key          # optional, for AI Insights

Usage

With Claude Code

claude "/yt-report"

This runs the full pipeline interactively, including the optional AI Insights stage.

With Node.js directly

node scripts/pipeline.js

Scheduled (Modal)

The pipeline runs automatically every Monday at 6:00 AM Israel time via Modal.

# Deploy the scheduled app
modal deploy modal_app.py

# Manual run
modal run modal_app.py::run_pipeline_manual

# Manual run without email
modal run modal_app.py::run_pipeline_manual --no-email

Project Structure

scripts/
  pipeline.js              # Main orchestrator
  collect/youtube-api.js   # YouTube Data API collector
  analyze/analyze-data.js  # Analysis orchestrator (trends, benchmarks, competitors, gaps)
  report/generate-slides.js # PPTX deck generator
  deliver/send-report.js   # Email delivery
context/
  search-config.json       # 14 search queries + settings
modal_app.py               # Modal deployment with weekly cron

API Quota

YouTube Data API has a 10,000 unit/day limit. Each pipeline run uses ~1,400 units, allowing ~7 runs per day.

Adapting to Other Niches

Use the yt-niche-pipeline skill to reconfigure search queries, trend terms, and slide branding for a different topic.

License

Private project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors