YouTube - Obtenir les commentaires de la vidéo
Ceci est unMarket Researchworkflow d'automatisation du domainecontenant 16 nœuds.Utilise principalement des nœuds comme If, SplitOut, HttpRequest, GoogleSheets, ManualTrigger. Extraire les commentaires de vidéos YouTube et les stocker dans Google Sheets
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
- •Informations d'identification Google Sheets API
Nœuds utilisés (16)
Catégorie
{
"id": "XVI3nC7HVl7JU6C5",
"meta": {
"instanceId": "ed6d846a2fce1f660ede2e7da800724cca01dc3d0685524a3c917881b7cfcfe9",
"templateCredsSetupCompleted": true
},
"name": "Youtube - Get Video Comments",
"tags": [
{
"id": "CEVEeZJa4qgPvdpK",
"name": "youtube",
"createdAt": "2025-05-27T02:29:43.874Z",
"updatedAt": "2025-05-27T02:29:43.874Z"
}
],
"nodes": [
{
"id": "7677397f-8b7b-4428-84c9-b25a0e8f6fe9",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
-620,
340
],
"parameters": {
"options": {},
"fieldToSplitOut": "body.items"
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "ecc0c645-7297-4279-be21-7f623d84dd6d",
"name": "If - Vérifier la réponse de succès",
"type": "n8n-nodes-base.if",
"position": [
-840,
500
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bce76f94-5904-4fdb-b172-adc1134855f9",
"operator": {
"type": "number",
"operation": "equals"
},
"leftValue": "={{ $json.statusCode }}",
"rightValue": 200
}
]
}
},
"typeVersion": 2.2
},
{
"id": "f0d9fee0-dded-486e-90a6-0992c14c4731",
"name": "Google Sheets - Mettre à jour le statut",
"type": "n8n-nodes-base.googleSheets",
"position": [
340,
480
],
"parameters": {
"columns": {
"value": {
"status": "finish",
"row_number": "={{ $('Google Sheets - Get Video URLs').item.json.row_number }}",
"last_fetched_time": "={{ $now.toISO().toString().slice(0, 19).replace('T', ' ') }}"
},
"schema": [
{
"id": "status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "video_url",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "video_url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "last_fetched_time",
"type": "string",
"display": true,
"required": false,
"displayName": "last_fetched_time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 426418282,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18-3CmJPbC73MycmNiSWotdsyGBAAzqESf33vktwnYmM/edit#gid=426418282",
"cachedResultName": "Video URLs"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit?usp=drivesdk",
"cachedResultName": "YouTube - Crawl Video Comments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pe6UD1A6MWIk2X91",
"name": "Google Sheets - toan.ngo"
}
},
"executeOnce": true,
"typeVersion": 4.5
},
{
"id": "47690f02-9a22-4bc7-8ee7-112b1c9d9b0b",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1440,
480
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "ab7d7339-f848-4ea3-9370-4d9c6a36515a",
"name": "If - Vérifier que l'URL vidéo n'est pas vide",
"type": "n8n-nodes-base.if",
"position": [
-1800,
500
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "8bf50878-b1b3-45dd-9639-98238fcef579",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.video_url }}",
"rightValue": ""
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "3b3e13e1-1ac9-4e86-b1b5-b67547a4fc80",
"name": "HTTP Request - Obtenir les commentaires",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1220,
500
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/commentThreads",
"options": {
"response": {
"response": {
"fullResponse": true,
"responseFormat": "json"
}
},
"pagination": {
"pagination": {
"parameters": {
"parameters": [
{
"name": "pageToken",
"value": "={{ $response.body.nextPageToken }}"
}
]
},
"completeExpression": "={{ !$response.body.nextPageToken}}",
"paginationCompleteWhen": "other"
}
}
},
"sendQuery": true,
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": [
{
"name": "part",
"value": "snippet"
},
{
"name": "videoId",
"value": "={{ $json.video_url.match(/(?:v=|\\/)([0-9A-Za-z_-]{11})/)[1] || ''}}"
},
{
"name": "limit",
"value": "100"
}
]
},
"nodeCredentialType": "youTubeOAuth2Api"
},
"credentials": {
"youTubeOAuth2Api": {
"id": "KhD0GLQGWl8MtqCs",
"name": "YouTube - toan.ngo"
}
},
"typeVersion": 4.2
},
{
"id": "b1c18c3c-8eb7-42a8-b2dd-1d98199a20f3",
"name": "If - Vérifier l'existence du commentaire",
"type": "n8n-nodes-base.if",
"position": [
-420,
340
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e4d47098-097d-4fd7-9703-638858f9565a",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.snippet.videoId }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "993d9d75-9db9-4ef6-98aa-7598ca390bd3",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3080,
-140
],
"parameters": {
"width": 700,
"height": 1420,
"content": "## [Agent Circle's N8N Workflow] YouTube Video Comment Crawler - Try It Out!\n\n**This n8n template demonstrates how to use the tool to crawl comments from a YouTube video and simply get all the results in a linked Google Sheet.**\n\nUse cases are many: Whether you're **a YouTube creator** trying to understand your audience, **a marketer** running sample analysis, **a data analyst** compiling engagement metrics, or part of **a growth team** tracking YouTube or social media campaign performance, this workflow helps you extract real, actionable insights from YouTube video comments at scale.\n\n## How It Works\n- The workflow starts when you manually click **Test Workflow** or **Execute Workflow** in N8N.\n- It reads the list of YouTube video URLs from the **Video URLs** tab in the connected **YouTube – Get Video Comments** Google Sheet. Only the URLs marked with the **Ready** status will be processed.\n- The tool loops through each video and sends an HTTP request to the YouTube API to fetch comment data.\n- Then, it checks whether the request is successful before continuing.\n- If comments are found, they are split and processed.\n- Each comment is then inserted in the **Results** tab of the connected **YouTube – Get Video Comments** Google Sheet.\n- Once a URL has been finished, its status in the **Video URLs** tab of the **YouTube – Get Video Comments** Google Sheet is updated to **Finished**. \n\n## How To Use\n- Download the workflow package. \n- Import the workflow package into your N8N interface.\n- Duplicate the [**YouTube - Get Video Comments** Google Sheet template](https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit?gid=426418282#gid=426418282) into your Google Sheets account.\n- Set up **Google Cloud Console** credentials in the following nodes in N8N, ensuring enabled access and suitable rights to Google Sheets and YouTube services:\n + For Google Sheets access, ensure each node is properly connected to the correct tab in your connected Google Sheet template: \n Node **Google Sheets - Get Video URLs** → connected to the **Video URLs** tab; \n Node **Google Sheets - Insert/Update Comment** → connected to the **Results** tab; \n Node **Google Sheets - Update Status** connected to the **Video URLs** tab.\n + For YouTube access: Set up a GET method in Node **HTTP Request - Get Comments**.\n- Open the template in your Google Sheets account. In the tab **Video URLs**, fill in the video URLs you want to crawl in **Column B** and update the status for each row in **Column A** to **Ready**.\n- Return to the N8N interface and click **Execute Workflow**.\n- Check the results in the **Results** tab of the template - the collected comments will appear there.\n\n## Requirements\n- Basic setup in Google Cloud Console (OAuth or API Key method enabled) with enabled access to YouTube and Google Sheets.\n\n## How To Customize\n- By default, the workflow is manually triggered in N8N. However, you can automate the process by adding a Google Sheets trigger that monitors new entries in your connected **YouTube – Get Video Comments** template and starts the workflow automatically.\n\n## Need Help?\nJoin our community on different platforms for support, inspiration and tips from others.\n\nWebsite: https://www.agentcircle.ai/\nEtsy: https://www.etsy.com/shop/AgentCircle\nGumroad: http://agentcircle.gumroad.com/\nDiscord Global: https://discord.gg/d8SkCzKwnP\nFB Page Global: https://www.facebook.com/agentcircle/\nFB Group Global: https://www.facebook.com/groups/aiagentcircle/\nX: https://x.com/agent_circle\nYouTube: https://www.youtube.com/@agentcircle\nLinkedIn: https://www.linkedin.com/company/agentcircle"
},
"typeVersion": 1
},
{
"id": "95fa0de2-7dbd-4ce3-be2b-1f3aa0a25f9b",
"name": "Google Sheets - Obtenir les URLs vidéo",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1960,
500
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "ready",
"lookupColumn": "status"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 426418282,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit#gid=426418282",
"cachedResultName": "Video URLs"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit?usp=drivesdk",
"cachedResultName": "YouTube - Crawl Video Comments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pe6UD1A6MWIk2X91",
"name": "Google Sheets - toan.ngo"
}
},
"typeVersion": 4.5
},
{
"id": "4aab513c-f3f7-4014-92e7-95a584f8d35b",
"name": "Google Sheets - Insérer/Mettre à jour le commentaire",
"type": "n8n-nodes-base.googleSheets",
"position": [
140,
340
],
"parameters": {
"columns": {
"value": {
"likes": "={{ $json.snippet.topLevelComment.snippet.likeCount }}",
"reply": "={{ $json.snippet.totalReplyCount }}",
"comment": "={{ $json.snippet.topLevelComment.snippet.textOriginal }}",
"video_url": "=https://www.youtube.com/watch?v={{ $json.snippet.videoId }}",
"comment_id": "={{ $json.snippet.topLevelComment.id }}",
"author_name": "={{ $json.snippet.topLevelComment.snippet.authorDisplayName }}",
"published_at": "={{ $json.snippet.topLevelComment.snippet.publishedAt.toString().slice(0, 19).replace('T', ' ') }}"
},
"schema": [
{
"id": "video_url",
"type": "string",
"display": true,
"required": false,
"displayName": "video_url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "comment_id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "comment_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "comment",
"type": "string",
"display": true,
"required": false,
"displayName": "comment",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "author_name",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "author_name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "likes",
"type": "string",
"display": true,
"required": false,
"displayName": "likes",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "reply",
"type": "string",
"display": true,
"required": false,
"displayName": "reply",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "published_at",
"type": "string",
"display": true,
"required": false,
"displayName": "published_at",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"comment_id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18-3CmJPbC73MycmNiSWotdsyGBAAzqESf33vktwnYmM/edit#gid=0",
"cachedResultName": "Results "
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit?usp=drivesdk",
"cachedResultName": "YouTube - Crawl Video Comments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pe6UD1A6MWIk2X91",
"name": "Google Sheets - toan.ngo"
}
},
"typeVersion": 4.5
},
{
"id": "b22f440c-caac-4812-8ec4-02ee4aaeb85a",
"name": "Test Workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-2140,
500
],
"parameters": {},
"typeVersion": 1
},
{
"id": "893156f1-ef54-42dd-9aa6-5f3c8fc4d6ce",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2180,
120
],
"parameters": {
"color": 7,
"width": 580,
"height": 720,
"content": "## 1. Read Video URLs From Connected Google Sheet\n\n- We’ll start by pulling a list of YouTube video URLs from your connected Google Sheet. Only the rows where the status is set to **Ready** will be picked up for processing. \n- Our tool only runs on rows where both the video URL and the **Ready** status have been properly filled in.\n"
},
"typeVersion": 1
},
{
"id": "efc99293-f219-40e4-9980-ca96ed1ff156",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1500,
120
],
"parameters": {
"color": 7,
"width": 480,
"height": 720,
"content": "## 2. Fetch Comments Via YouTube API\n\n- Each video URL is passed through a request to the YouTube API in a loop.\n- You just need to make sure your YouTube API key is correctly set in the **HTTP Request - Get Comments** node."
},
"typeVersion": 1
},
{
"id": "0254b9d7-ad4a-42b9-b1f2-d412184b67d4",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-920,
100
],
"parameters": {
"color": 7,
"width": 860,
"height": 720,
"content": "## 3. Validate Response And Split Comments\n\n- Once the workflow receives a response from the YouTube API, it first checks if the request was successful.\n- If everything looks good, it splits the returned comment data into individual entries. This makes it easier to process and save them one by one.\n- Each comment is then checked to ensure it’s valid and not empty before continuing to the next step.\n\n"
},
"typeVersion": 1
},
{
"id": "d66bf88b-b703-4d41-b328-363e9fd2aa7e",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
40,
100
],
"parameters": {
"color": 7,
"width": 480,
"height": 720,
"content": "## 4. Save Comments And Update URL Status In Google Sheets\n\n- All collected comments are inserted into the **Results** tab in your connected Google Sheet.\n- After each video is processed, its original row is marked as **Finished** automatically to prevent it from being reprocessed.\n- Then, the tool moves on to the next available video, if one exists."
},
"typeVersion": 1
},
{
"id": "29abcb72-024c-43bb-a726-ba513f12f0fb",
"name": "Google Sheets - Mettre à jour le statut - Erreur",
"type": "n8n-nodes-base.googleSheets",
"position": [
140,
580
],
"parameters": {
"columns": {
"value": {
"status": "error",
"row_number": "={{ $('Google Sheets - Get Video URLs').item.json.row_number }}",
"last_fetched_time": "={{ $now.toISO().toString().slice(0, 19).replace('T', ' ') }}"
},
"schema": [
{
"id": "status",
"type": "string",
"display": true,
"required": false,
"displayName": "status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "video_url",
"type": "string",
"display": true,
"required": false,
"displayName": "video_url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "last_fetched_time",
"type": "string",
"display": true,
"required": false,
"displayName": "last_fetched_time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 426418282,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit#gid=426418282",
"cachedResultName": "Video URLs"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1F5yEhjBWu3fnwgHGLsPLD9_tWRqUnxu4p0DEvUTae1Y/edit?usp=drivesdk",
"cachedResultName": "YouTube - Get Video Comments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pe6UD1A6MWIk2X91",
"name": "Google Sheets - toan.ngo"
}
},
"typeVersion": 4.6
}
],
"active": false,
"pinData": {
"Test Workflow": [
{
"json": {}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "386de5d5-8061-49e2-868f-0e04f358a9d1",
"connections": {
"7677397f-8b7b-4428-84c9-b25a0e8f6fe9": {
"main": [
[
{
"node": "b1c18c3c-8eb7-42a8-b2dd-1d98199a20f3",
"type": "main",
"index": 0
}
]
]
},
"b22f440c-caac-4812-8ec4-02ee4aaeb85a": {
"main": [
[
{
"node": "95fa0de2-7dbd-4ce3-be2b-1f3aa0a25f9b",
"type": "main",
"index": 0
}
]
]
},
"47690f02-9a22-4bc7-8ee7-112b1c9d9b0b": {
"main": [
[],
[
{
"node": "3b3e13e1-1ac9-4e86-b1b5-b67547a4fc80",
"type": "main",
"index": 0
}
]
]
},
"b1c18c3c-8eb7-42a8-b2dd-1d98199a20f3": {
"main": [
[
{
"node": "4aab513c-f3f7-4014-92e7-95a584f8d35b",
"type": "main",
"index": 0
}
],
[
{
"node": "29abcb72-024c-43bb-a726-ba513f12f0fb",
"type": "main",
"index": 0
}
]
]
},
"3b3e13e1-1ac9-4e86-b1b5-b67547a4fc80": {
"main": [
[
{
"node": "ecc0c645-7297-4279-be21-7f623d84dd6d",
"type": "main",
"index": 0
}
]
]
},
"ecc0c645-7297-4279-be21-7f623d84dd6d": {
"main": [
[
{
"node": "7677397f-8b7b-4428-84c9-b25a0e8f6fe9",
"type": "main",
"index": 0
}
],
[
{
"node": "29abcb72-024c-43bb-a726-ba513f12f0fb",
"type": "main",
"index": 0
}
]
]
},
"f0d9fee0-dded-486e-90a6-0992c14c4731": {
"main": [
[
{
"node": "47690f02-9a22-4bc7-8ee7-112b1c9d9b0b",
"type": "main",
"index": 0
}
]
]
},
"95fa0de2-7dbd-4ce3-be2b-1f3aa0a25f9b": {
"main": [
[
{
"node": "ab7d7339-f848-4ea3-9370-4d9c6a36515a",
"type": "main",
"index": 0
}
]
]
},
"ab7d7339-f848-4ea3-9370-4d9c6a36515a": {
"main": [
[
{
"node": "47690f02-9a22-4bc7-8ee7-112b1c9d9b0b",
"type": "main",
"index": 0
}
]
]
},
"4aab513c-f3f7-4014-92e7-95a584f8d35b": {
"main": [
[
{
"node": "f0d9fee0-dded-486e-90a6-0992c14c4731",
"type": "main",
"index": 0
}
]
]
},
"29abcb72-024c-43bb-a726-ba513f12f0fb": {
"main": [
[
{
"node": "47690f02-9a22-4bc7-8ee7-112b1c9d9b0b",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - Étude de marché
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Agent Circle
@agentcircleAgent Circle - A growing marketplace of AI agents, workflows, and toolkits — built to help teams automate smarter and scale faster
Partager ce workflow