YouTube Comments Analyzer - YouTube Video Comment Analyzer to Generate Content Ideas
.jpeg)

Process description
This automation is an intelligent system for analyzing comments on YouTube videos in order to identify the most popular topics for new videos. The system takes a link to a YouTube video, extracts up to 100 comments via the YouTube Data API, analyzes them using Google Gemini AI to identify patterns and audience requests, generates structured ideas for future videos, and stores the results in Airtable for further content planning.
API keys and services:
- YouTube Data API v3 - to receive comments (API key required)
- Google Gemini API - for AI comment analysis
- Airtable Personal Access Token - to save ideas
- Airtable - to record the result
System architecture by blocks
SECTION 1: RETRIEVING DATA

1.1 On form submission - Web form for entering URLs
Purpose: Provides a simple interface for entering a YouTube video link
Form settings:
- Form Title: “Analyzing comments”
- Form Fields:
- Field Label: YoutubeURL
- Placeholder: url
- Required Field: true
- Webhook ID: (your webhook will automatically stand up)
Supported URL formats:
- https://youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID
- https://youtube.com/embed/VIDEO_ID
- https://youtube.com/shorts/VIDEO_ID
- https://youtube.com/live/VIDEO_ID
- Direct Video ID (11 characters)
1.2 Code - Video ID Extraction
Purpose: Parses various YouTube URL formats and extracts Video ID for API requests
JavaScript code:
function extractVideoid (url) {
const patterns = [
/(? :youtube\ .com\ /watch\? v=|youtu\ .be\ /|youtube\ .com\ /embed\ /|youtube\ .com\ /v\/) ([^&\n? #] +)/,
/youtube\ .com\ /shorts\/([^&\n? #] +)/,
/youtube\ .com\ /live\/([^&\n? #] +)/
];
for (const pattern of patterns) {
const match = url.match (pattern);
if (match && match [1]) {
return match [1];
}
}
//If the URL is already a VideoID (11 characters)
if (/^ [A-zA-Z0-9_-] {11} $/.test (url)) {
return url;
}
return null;
}
const YouTubeURL = $Json.YouTubeURL;
const videoID = extractVideoid (YouTubeURL);
if (! videoID) {
throw new Error (“Could not extract Video ID from URL:" + YoutubeURL);
}
return {
VideoID: VideoID,
OriginalURL: YoutubeURL
};
Processing examples:
- https://youtube.com/watch?v=dQw4w9WgXcQ → dqw4w9wgxcq
- https://youtu.be/dQw4w9WgXcQ → dqw4w9wgxcq
- DQW4W9WGXCQ → DQW4W9WGXCQ
1.3 HTTP Request - Getting comments
Purpose: Uploads comments via the official YouTube Data API
HTTP Request settings:
- URL: https://www.googleapis.com/youtube/v3/commentThreads
- Method: GET
- Query Parameters:
- part: snippet (basic comment info)
- VideoID: {{$Json.videoid}} (extracted Video ID)
- MaxResults: 100 (maximum comments)
- key: [YOUR API KEY] (needs to be replaced)
An example of a YouTube API response:
{
“items”: [
{
“snippet”: {
“TopLevelComment”: {
“snippet”: {
TextOriginal: “Great video! Can you talk about cryptocurrencies?” ,
AuthorDisplayName: Ivan Petrov,
“LikeCount”: 15,
PublishEDAT: 2024-01-15T 10:30:00 Z
}
}
}
},
{
“snippet”: {
“TopLevelComment”: {
“snippet”: {
TextOriginal: “Very useful! I would like a video about investments”,
AuthorDisplayName: Maria Ivanova,
“LikeCount”: 8,
PublishEDAT: 2024-01-15T 11:45:00 Z
}
}
}
}
]
}
1.4 Code1 - Extract comment text
Purpose: Processes the API response and retrieves comment texts only
JavaScript code:
//Get data from HTTP Request
const response = $input.first () .json;
const items = response.items || [];
//Extract comment texts only
const comments = items.map (thread => {
return Thread.snippet.toplevelcomment.snippet.textOriginal;
});
//Return an array of comments
return comments.map (text => ({comment: text}));
The result: An array of objects with comments in a format that is convenient for analysis.
SECTION 2: PREPARATION FOR ANALYSIS

2.1 Aggregate - Merge comments
Purpose: Collects all comments into a single array for transmission to AI
Settings:
- Fields To Aggregate: comment
- Options: {} (default settings)
The result: A single object with all comments in the comment field as an array.
SECTION 3: AI COMMENT ANALYSIS

3.1 AI Agent — Intelligent Analysis
Purpose: Analyzes comments to identify the most popular topics
Connected components:
- Google Gemini Chat Model - main language model
- Simple Memory - memory for the analysis context
- Structured Output Parser - providing JSON format
Input data:
Comments: {{$json.comment.join (”\n\n“)}}
Detailed system prompt:
Analyze the comments below and find 3-4 of the most popular topics for new videos.
Rules:
1. Seek direct requests and questions
2. Group similar searches
3. Ignore general compliments
4. Take into account only specific offers
Give your answer in the format:
1. ** [Video title] ** - [why requested] (mentioned X times)
2. ** [Video title] ** - [why requested] (mentioned X times)
3. ** [Video title] ** - [why requested] (mentioned X times)
4. ** [Video title] ** - [why requested] (mentioned X times)
+ Main audience insight: [observation]
Find 3 video ideas and return them STRICTLY in the format:
{
“idea1": {
“title”: “video title”,
“reason”: “why is it in demand”,
“mentions”: number
},
“idea2": {
“title”: “video title”,
“reason”: “why is it in demand”,
“mentions”: number
},
“idea3": {
“title”: “video title”,
“reason”: “why is it in demand”,
“mentions”: number
},
MainInsight: “the ultimate audience insight”
}
IMPORTANT: The answer should be JSON ONLY, no explanation!
AI analysis algorithm:
- Pattern scanning: Searches for recurring queries and topics
- Grouping requests: Combines similar requests
- Counting mentions: Counts the frequency of each topic
- Ranking: Sorts by demand
- Insights generation: Identifies general audience trends
3.2 Google Gemini Chat Model — Language Model
Purpose: Provides AI Agent with advanced Russian language understanding capabilities
Settings:
- Model: Google Gemini
- Options: {} (standard parameters)
- Credentials: Google Gemini API account 2 (ID: 20Golxtpmrf8HW07)
Gemini's advantages for this task:
- Excellent understanding of the Russian language
- The ability to analyze text in a complex way
- Effective grouping and classification
- Cost effective compared to GPT-4
3.3 Structured Output Parser - Structured Output
Purpose: Ensures a correct JSON response from AI
JSON Schema:
{
“type”: “object”,
“properties”: {
“ideas”: {
“type”: “array”,
“items”: {
“type”: “object”,
“properties”: {
“title”: {"type”: “string"},
“reason”: {"type”: “string"},
“mentions”: {"type”: “integer"}
},
“required”: ["title”, “reason”, “mentions"]
},
“miniItems”: 3,
“MaxItems”: 3
},
“insight”: {"type”: “string"}
},
“required”: ["ideas”, “insight"]
}
An example of structured output:
{
“ideas”: [
{
“title”: “How to invest in cryptocurrencies for beginners”,
“reason”: “Multiple requests to explain the basics of crypto investments”,
“mentions”: 12
},
{
“title”: “Top 5 mistakes when starting a business”,
“reason”: “Frequently asked questions about the pitfalls of entrepreneurship”,
“mentions”: 8
},
{
“title”: “Passive income: real ways 2024",
“reason”: “A popular topic in the comments about additional income”,
“mentions”: 15
}
],
“insight”: “The audience is actively interested in financial literacy and ways to earn money, especially passive methods”
}
SECTION 4: SAVING RESULTS

4.1 Split Out — Sharing ideas
Purpose: Converts an array of ideas into separate elements for individual preservation
Settings:
- Field To Split Out: output.ideas
- Options: {} (default settings)
The result: Each idea becomes a separate element in the data stream.
4.2 Create a record - Save to Airtable
Purpose: Saves each idea as a separate entry in the Airtable database
Airtable settings:
- Operation: create
- Base: your base
- Table: your table
- Credentials: your api key
Columns Mapping:
- Ideas: {{$json.title}} (video title)
- Reason: {{$json.reason}} (why it's in demand)
- Mention: {{$json.mentions}} (number of mentions)
The structure of the Airtable final table:
Ideas
Reason
Mention
How to invest in cryptocurrencies for beginners
Multiple requests to explain the basics
12
Top 5 mistakes when starting a business
Frequently asked questions about pitfalls
8
Passive income: real ways 2024
A popular topic about additional income
15
Node connection diagram
Main stream:
- On form submission → Code → HTTP Request → Code1
- Code1 → Aggregate → AI Agent
- AI Agent → Split Out → Create a record
AI connections:
- Google Gemini Chat Model → AI Agent
- Simple Memory → AI Agent
- Structured Output Parser → AI Agent
Required services and their settings
YouTube Data API setup:
- Create a project in Google Cloud Console
- Enable YouTube Data API v3
- Get an API key and replace “YOUR API KEY” in the code
- Set up quotas (usually 10,000 units per day for free)
- Price: 1 unit per request for comments
Google Gemini setup:
- Get the API key on ai.google.dev
- Set up billing (if required)
- Make sure you have your request limits
Airtable setup:
- Create an “Idea” database
- Create a table with fields:
- Ideas (Single line text)
- Reason (Long text)
- Mention (Number)
- Get a Personal Access Token
- Configure access rights
System capabilities
Comment analysis:
- Processing up to 100 comments per request
- Universal URL parser - support for all YouTube formats
- Intelligent filtering - elimination of spam and common phrases
- Grouping requests - combining similar topics
AI capabilities:
- Semantic analysis - understanding the meaning, not just keywords
- Counting mentions - quantitative assessment of demand
- Prioritizing ideas - ranking by demand
- Audience insights - identifying common patterns
Structured preservation:
- Airtable integration - a convenient database of ideas
- Ready-to-use data - name, reason, priority
- The ability to sort - by mentions, dates, categories
- Collaboration - team access to ideas
System application
For YouTube channels:
- Content planning - ideas based on real audience requests
- Increasing engagement - videos on topics that are really interesting
- Competitor analysis - studying comments under other people's videos
- Validation of ideas - checking demand before creating videos
For content agencies:
- Market research - quick analysis of audience needs
- Content strategy - data for clients' content plans
- Competitive analysis - monitoring trends in the niche
- Reporting to customers - structured insights
For marketers:
- User research - understanding the needs of the target audience
- Hypothesis testing - testing ideas before investing
- Content marketing - blog and social media themes
- Product insights - ideas for product development
The result of the system
What happens is:
- Content Idea Database based on real audience requests
- Prioritized list of topics with quantitative metrics
- Audience insights to improve the strategy
- Save time for research and planning
- Increasing relevance created content
Performance metrics:
- Analysis time: 2-3 minutes for 100 comments
- Extraction accuracy: 95% + correct Video IDs
- The quality of ideas: structured data with justification
- Scalability: analysis of any number of videos
Advantages over manual analysis:
- Speed - minutes instead of hours to analyze comments
- Objectivity - elimination of human prejudices
- Structuring - ready data for planning
- Scalability - analysis of multiple videos in a row
- Quantitative assessment - accurate demand metrics
ROI and business indicators:
- Increasing views - content on popular topics
- Increased engagement - videos answer real questions
- Savings on research - market research automation
- Risk reduction - validation of ideas before production
This system turns YouTube comments into a valuable source of content ideas based on the audience's real needs!