YouTube Top Video Tracker with Google Sheets - n8n Workflow

This powerful n8n workflow template automatically retrieves the most-viewed YouTube videos from specified channel IDs defined in Google Sheets using the YouTube API, storing structured data directly back into another sheet.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content analysts and researchers tracking competitor YouTube channel performance.

  • Marketing teams needing automated reporting on trending video content.

  • Anyone looking for an advanced n8n workflow example utilizing APIs and spreadsheets.

  • Users searching for efficient n8n templates for data collection.

Overview

Manually monitoring the top-performing videos across several YouTube channels can be time-consuming and prone to errors. This automated n8n workflow solves this by streamlining the data extraction process. It uses Google Sheets as a configuration source, allowing you to easily manage a list of channels and how many top videos you wish to retrieve from each. By utilizing the YouTube Data API and filtering by viewCount, this n8n automation ensures you consistently capture the most popular content. This robust n8n workflow significantly reduces manual effort, providing clean, updated data ready for analysis in Google Sheets.

How it Works

This powerful n8n workflow starts with a manual n8n trigger, initiating the process when executed within the n8n interface.


  1. Configuration Retrieval: The first active n8n node uses the Google Sheets integration to read channel configurations (Channel ID and the number of videos to fetch) from a designated 'Input Sheet'.

  2. API Request: For each channel retrieved from the sheet, an HTTP Request n8n node calls the YouTube Data API v3. This crucial step is configured to order the results by viewCount, ensuring only the most popular videos are returned.

  3. Data Structuring: The response, which contains multiple video results, is passed to a Split Out n8n node. This ensures that each individual video item is treated as a separate data entry in the subsequent steps.

  4. Data Logging: The final n8n node, a Google Sheets Append operation, takes the structured video details (title, video link, channel name) and appends them sequentially to a designated 'Output Sheet'. This complete n8n workflow provides a robust, scheduled way to track performance.

Installation Guide

To set up this n8n workflow template, follow the steps below:


  1. Import the n8n workflow: Copy the provided JSON and import it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Sheets Credentials: Ensure you have a Google Sheets credential configured in your n8n environment. If not, create one under the 'Credentials' section.

  3. YouTube API Key: Obtain a YouTube Data API v3 key from the Google Cloud Console. Enable the API and generate an API key.

  4. Google Sheet Structure: Create a single Google Spreadsheet document containing two tabs:

Input Sheet (e.g., 'Channels'): Must include columns for ChannelID (the specific YT channel ID) and videonumtoget (the maximum number of videos to retrieve).
Output Sheet (e.g., 'Results'): This sheet will receive the output with columns: channelName, title, videoId, and videoLink.

  1. Configure Google Sheets n8n Node: In both the 'Read Channel Info from Sheet' and 'Append Video Details to Sheet' nodes, select your Google Sheets credential, enter your Spreadsheet ID, and specify the correct Input and Output sheet names.

  2. Configure HTTP Request n8n Node: In the 'Fetch Most-Viewed Videos via YouTube API' node, replace the placeholder YOURYOUTUBEAPIKEY with your actual YouTube API key in the query parameters.

Node Details

When clicking ‘Execute workflow’ (Manual Trigger): This is the entry n8n trigger. It manually starts the execution of this n8n workflow for testing or immediate runs.
Read Channel Info from Sheet (Google Sheets n8n node):
Function: Reads the configuration data (Channel IDs and requested video count) from the specified input Google Sheet.
Key Configuration: Configured to read all data from YOURINPUTSHEETNAME using a defined Spreadsheet ID.
Fetch Most-Viewed Videos via YouTube API (HTTP Request n8n node):
Function: Executes the core data retrieval. It calls the YouTube API, dynamically inserting the ChannelID and maxResults from the previous n8n node. It specifies order=viewCount to ensure popularity sorting.
Key Configuration: Uses dynamic expressions like ={{ $json.ChannelID }} and requires replacement of YOURYOUTUBEAPIKEY.
Split Into Individual Videos (Split Out n8n node):
Function: Takes the API response, which is an array of video items, and splits it into separate executions, ensuring each subsequent n8n node receives data for one video at a time.
Key Configuration: Splits the data based on the items field.
Append Video Details to Sheet (Google Sheets n8n node):
Function: Appends the structured output data (Title, Video ID, Link, Channel Name) to the designated output sheet.
* Key Configuration: Uses the append operation and maps dynamic data fields like ={{ $json.items.snippet.title }} to output columns in YOUROUTPUTSHEET_NAME.

Related n8n Workflows

Free

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

Featured*