Content · n8n

Automatically Log Every New YouTube Comment to Google Sheets

Whenever a new comment is posted on your YouTube video, this workflow captures it and appends a row to your Google Sheet. Creators get a searchable, sortable comment log without manual copy-pasting.

difficulty Beginnersetup 30 minresult A live Google Sheet that automatically records every new YouTube comment with the author name, comment text, video ID, and timestamp.
  1. 1

    Schedule the workflow to run every hour

    Add a Schedule Trigger node. Set Trigger Interval to Hours and Hours Between Triggers to 1. This polls YouTube regularly without hitting API quota limits.

  2. 2

    Fetch recent comments from YouTube

    Add an HTTP Request node. Set Method to GET and URL to https://www.googleapis.com/youtube/v3/commentThreads. In Query Parameters add: part = snippet, videoId = your YouTube video ID, maxResults = 50, order = time, and key = your YouTube Data API key. Store your API key in the node Notes and paste it into the key parameter.

  3. 3

    Extract the comment items from the response

    Add a Set node. Create a field called comments and set its value to the expression {{ $json.items }}. This isolates the array of comment objects returned by the YouTube API so the next node can loop over them.

  4. 4

    Split comments into individual items

    Add a Split In Batches node — or use the built-in Split Out option. Actually, add an Item Lists node (n8n-nodes-base.itemLists) and set Operation to Split Out Items, with Field To Split Out set to comments. Each comment object now flows as its own item.

  5. 5

    Append each comment as a row in Google Sheets

    Add a Google Sheets node. Set Operation to Append. Connect your Google Sheets OAuth2 credential. Set Spreadsheet ID to your sheet's ID (found in the URL) and Sheet Name to Comments. Map columns: Author = {{ $json.snippet.topLevelComment.snippet.authorDisplayName }}, Comment = {{ $json.snippet.topLevelComment.snippet.textOriginal }}, Published At = {{ $json.snippet.topLevelComment.snippet.publishedAt }}, Video ID = {{ $json.snippet.videoId }}.

Frequently asked questions

Will I get duplicate rows if the same comment is fetched twice?

Yes, without deduplication. To prevent this, add a second sheet tab named 'Seen IDs' and use the `Google Sheets` node to check if a comment ID already exists before appending. For a beginner setup, simply run the trigger less frequently (e.g. daily) and manually clear old entries, or upgrade to an Intermediate workflow that includes an IF node for ID checks.

Can I monitor multiple videos at once?

Yes. Duplicate the `HTTP Request` node for each video ID, or store video IDs in a Google Sheet and use a `Google Sheets` read step at the start to loop through them. Keep in mind that each additional video increases your YouTube Data API quota usage.

How do I get a YouTube Data API key?

Go to console.cloud.google.com, create a new project, enable the YouTube Data API v3, and generate an API key under Credentials. Restrict the key to the YouTube Data API to keep it secure. Paste the key into the `key` query parameter of the HTTP Request node.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.