📊 YouTube comment sentiment analysis with Google Gemini AI and Google Sheets

690 views · 📊 Market Research & Insights

💡 Pro Tip — Since TikTok doesn’t have a public API, getting data usually means fragile HTTP scraping. ScraperNode is a community node that gives you clean JSON for TikTok profiles, videos, and comments — drop it into your workflow and skip the parsing.

View All Scrapers

Description

This workflow automatically collects all comments from a specified YouTube video and analyzes the sentiment of each comment using an AI model (e.g., GPT, Claude or Gemini). The sentiment (Positive, Neutral, or Negative), its strength, and confidence score are extracted and saved into a connected Google Sheet for easy access, reporting, and visualization.


Advantages:

🧠 AI-Powered Sentiment Analysis

📺 Ideal for YouTube Creators & Marketers

📈 Real-Time Feedback Monitoring

📊 Automatic Reporting

🔁 Handles Pagination

⚙️ No-Code Customization

📥 Simple Setup

🔁 Loop and Update Logic

🧩 Modular Design

💬 Multi-Language Compatibility

image


How It Works

  1. Trigger: The workflow starts manually (“When clicking ‘Test workflow’”) or can be scheduled.
  2. Fetch Comments: The “Get API Comments” node retrieves comments from a YouTube video using the YouTube API.
  3. Process Comments:
    • Extracts comments and replies via the “Comments” node.
    • Splits them into individual entries (“Split comments”).
    • Saves raw comments to Google Sheets (“Save comments”).
  4. Sentiment Analysis:
    • Uses Google Gemini AI (or another model) to classify each comment as Positive, Neutral, or Negative.
    • Captures strength and confidence metrics for deeper insights.
  5. Update Results: The “Update sentiment” node writes the analysis back to Google Sheets, marking processed rows.
  6. Pagination Handling: Checks for multiple pages of comments (“Multipage?”) and loops until all are processed.

Set Up Steps

  1. Prepare Google Sheet:

    • Clone the template: YouTube Comments Sheet.
    • Ensure columns exist: VIDEO_ID, COMMENTS, SENTIMENT, STRENGTH, CONFIDENCE, and DO (tracking column).
  2. Configure YouTube API:

    • Obtain a YouTube API key from Google Developers Console.
    • Add it to the “Get API Comments” node under Youtube Query Auth (parameter: key).
  3. Set Video ID:

    • Replace the default xxxxxxxx in the “ID Video” node with your target YouTube video ID.
  4. AI Integration:

    • Ensure Google Gemini API credentials are configured in the “Google Gemini” node.
  5. Run the Workflow:

    • Test manually or automate execution (e.g., hourly/daily) to analyze new comments.

Output: A Google Sheet with categorized sentiments, enabling trend analysis and audience engagement tracking.


Need help customizing?

Contact me for consulting and support or add me on Linkedin.

🔗 Nodes Used

Google Sheets, HTTP Request, QuickChart, Google Gemini Chat Model, Sentiment Analysis

📥 Import

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

📖 Importing guide · 🔑 Credential setup