YouTube Competitor Video Analytics to Google Sheets - n8n Workflow

Use this powerful n8n workflow to automate YouTube competitor analysis. Input a channel name, extract trending video metrics, calculate engagement, and seamlessly log all critical performance data into Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing Analysts and Content Strategists seeking data-driven competitor intelligence.
SEO and Growth Hackers who need to track trending content patterns.
Users looking for ready-to-use n8n templates to automate data extraction tasks.
Anyone who wants to analyze video performance using a custom engagement score calculated within an n8n node.

Overview

Manually tracking viral videos and calculating engagement rates for competitors is inefficient and prone to error. This specific n8n automation template solves this challenge by providing a structured mechanism for competitor video analysis. By leveraging the YouTube Data API within the n8n workflow, you input a channel name and the system automatically retrieves key information about their top videos (ordered by view count), including titles, URLs, view counts, and interaction metrics. Crucially, the n8n workflow calculates a custom performance metric (based on likes and comments relative to views). All extracted and calculated data is then efficiently organized and appended to a designated Google Sheet, ensuring your competitive intelligence is timely and actionable. This powerful n8n solution showcases the capability of combining API calls and custom logic.

How it Works

The entire process begins with the On form submission n8n trigger. The user inputs the target Channel Name, the desired number of videos, and video duration format (short, medium, long).


  1. Parameter Setup: The input data is standardized using the Set Parameters n8n node.

  2. Find Channel ID: The first HTTP Request n8n node queries the YouTube API (using the provided API key) to convert the channel name into the required Channel ID.

  3. Extract Channel ID: A Code n8n node processes the JSON response, isolating the Channel ID necessary for subsequent API calls.

  4. Get Video IDs: A subsequent HTTP Request n8n node searches for videos using the Channel ID, ordering the results by viewCount to find trending or viral videos, and adhering to the specified limit and format. This is a crucial data-gathering n8n node.

  5. Extract Detailed Data: The workflow iterates through the list of Video IDs using another HTTP Request n8n node to fetch detailed statistics and snippets (views, likes, comments, description, title) for each video.

  6. Custom Logic and Hook Generation: Two specialized Code n8n nodes refine the data. The first generates a short marketing 'hook' from the description. The second, named Video Performance, calculates the custom engagement score: ((likeCount + commentCount) / viewCount) * 100.

  7. Final Output: The Append row in sheet n8n node (Google Sheets) takes the complete, enriched dataset and logs it into your specified Google Sheet, completing the execution of this comprehensive n8n workflow.

Installation Guide

To utilize this n8n templates JSON, follow these steps:


  1. Import: Copy the provided JSON code and paste it into your n8n instance using the 'Import from JSON' function.

  2. Credentials - YouTube API: This n8n workflow requires credentials for the YouTube Data API (v3). Obtain your API key from Google Cloud Console and update the placeholder API key in the Set Parameters n8n node, or set up a dedicated credential for the HTTP Request nodes.

  3. Credentials - Google Sheets: Set up a Google Sheets OAuth2 credential. Configure the Append row in sheet1 n8n node, selecting the correct spreadsheet and sheet name where the analytics data will be stored.

  4. Activation: Once credentials are set, activate the n8n workflow. Access the associated form URL from the On form submission1 n8n trigger node to initiate the analysis.

Node Details

On form submission1 (Form Trigger): This acts as the initial n8n trigger, capturing user input for the Channel Name, Number of Videos, and Video Format (duration).
HTTP Request (Get Channel ID1 & Get Video IDs1 & Get Video Data1): These n8n nodes are essential for interacting with the YouTube Data API. They handle the sequential steps of finding the Channel ID, listing the top Video IDs ordered by view count, and fetching detailed statistics for each video.
Code (Extract Channel ID1, Extract IDs1, Extract Video Data1): These utility n8n node steps are used for parsing complex API responses, flattening the JSON structure, and extracting specific fields (like IDs, titles, and counts) needed for the next step in the n8n workflow.
Code (Video Performance1): A critical custom n8n node that calculates the engagement ratio, providing a data point useful for competitive analysis.


  • Google Sheets (Append row in sheet1): The final n8n node used to persist the analyzed video performance data into a structured Google Sheet.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Building AI Calling | Voho Calling

Featured*