📊 Classify YouTube videos & generate email summaries with GPT-4 and Gmail

70 views · 📊 Market Research & Insights

💡 Pro Tip — YouTube’s API quotas can be a bottleneck when you’re pulling data at scale. ScraperNode is a community node with dedicated scrapers for channels, videos, and comments — no quota limits, just structured data.

View All Scrapers

Description

Classify YouTube Trends and Generate Email Summaries with GPT-4 and Gmail

YouTube Trend Detector YouTube OpenAI n8n Gmail SMTP

Monitor YouTube channels, fetch stats, classify videos as viral (≥ 1000 likes) or normal, and auto‑generate LinkedIn/email summaries with GPT‑4. Deliver via Gmail or SMTP. Clear node names, examples, and auditable fields.


🎯 Overview

This template monitors YouTube channels via RSS or the YouTube Data API, retrieves video stats, classifies each video as viral (≥ 1000 likes) or normal, and produces concise LinkedIn/email summaries with OpenAI (GPT‑4 family). It can send a compact weekly briefing via Gmail (OAuth2) or SMTP. Built for creators, marketing teams, and agencies who want automated trend alerts and ready‑to‑use content.

Screenshot-2025-10-16-085219

This screenshot shows the Gmail-ready weekly briefing generated by the Generate Weekly Briefing (HTML) node in my YouTube Trend Detector workflow, confirming the end-to-end pipeline: RSS/API → stats → like-based classification (≥ 1000 = viral) → LLM summaries → HTML email.


🧭 How It Works (Node Map)

  1. Manual Run – ad‑hoc execution
  2. Set Channel IDs – provide one or more YouTube channelId values
  3. Split Channels – process channels one by one
  4. Fetch Latest Videos (RSS) – pull recent uploads via channel RSS
  5. Filter: Published in Last 72h – only recent items are kept
  6. Get Video Stats (YouTube API) – request snippet,statistics for likes and details
  7. Classify by Likes (Code) – sets classification to viral or normal
  8. Branch: Normal / Branch: Viral – separate LLM prompts per relevance
  9. Write Post (Normal / Viral) – generate LinkedIn‑style notes via OpenAI
  10. Aggregate Posts for Briefing – merge all texts into one block
  11. Generate Weekly Briefing (HTML) – produce a Gmail‑robust HTML email via GPT
  12. Send Weekly Briefing (Gmail/SMTP) – deliver briefing (you set recipients)

⚙️ Quick Start (≈ 3 minutes)

  1. Import the sanitized JSON into n8n (Menu → Import).
  2. Create credentials (use exact names):
    • YouTube_API_Key — Generic credential (field: apiKey)
    • OpenAi account — OpenAI API Key
    • Gmail account (OAuth2) or SMTP_Default (SMTP)
  3. Configure channels: In Set Channel IDs, list your YouTube channelId values (e.g., UC…).
  4. Set recipients: In Send Weekly Briefing, add your target email(s).
  5. Test: Run Execute Workflow and review outputs from the LLM and send nodes.

🔑 Required Credentials


🧩 Key Parameters & Adjustments


🧪 Troubleshooting


🧾 Example Outputs

1) Classification (single video)

{
  "videoId": "abc123XYZ",
  "title": "How to Ship an n8n Workflow with OpenAI",
  "likeCount": 1587,
  "classification": "viral",
  "needsStatsFetch": false
}

2) LinkedIn draft (viral)

Did you know how much faster prompt workflows get with structured inputs?
• Setup: n8n + YouTube API + OpenAI for auto-briefs
• Tip: include `part=statistics` for reliable like counts
Useful for teams tracking trending how-to content.
What’s your best “viral” signal besides likes?
#n8n #YouTubeAPI #OpenAI #Automation #Growth

3) Plain‑text email preview

Subject: Weekly AI Briefing — YouTube Trend Highlights

Hi team,
Highlights from our tracked channels:
• Viral: “How to Ship an n8n Workflow with OpenAI” (1.6k likes)
• Normal: “RSS vs API: What’s Best for Monitoring?”
Generated via n8n + GPT‑4.

✅ Submission Checklist (meets the guidelines)


📸 Suggested Screenshots (optional)

  1. Full canvas overview (entire workflow)
  2. LLM output (expanded) showing generated summary
  3. Send‑node result with messageId/status
  4. Optional: aggregated briefing preview

📜 License & Support

License: MIT
Support/Contact: kaihoelters@yahoo.de

🔗 Nodes Used

HTTP Request, RSS Read, Gmail, OpenAI

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup