Veni AI
العودة إلى القوالب
قالب سير عمل

Trending Videos By Channel | Operasyon için n8n Otomasyon İş Akışı Şablonu (HTTP, Google Sheets)

n8n için hazır otomasyon şablonu: Trending Videos By Channel. 11 düğüm. Entegrasyonlar: HTTP, Google Sheets. JSON'u kopyalayıp n8n'e içe aktarın.

11 العُقدTrending_Videos_By_Channel-workflow.json
{
"id": "aaitjN3jwXzLUnjB",
"meta": {
"instanceId": "7b35059aff065837b1c7d24142b37474554b08b3370f3096b2e57345690d178e"
},
"name": "Trending Videos by Channel",
"tags": [],
"nodes": [
{
"id": "2496298c-0720-48c2-b814-d2e6884bba81",
"name": "On form submission1",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
384
],
"webhookId": "9aa528af-6673-4bfb-a84e-397e83b21f75",
"parameters": {
"options": {},
"formTitle": "YouTube Channel Analyzer",
"formFields": {
"values": [
{
"fieldType": "dropdown",
"fieldLabel": "Format",
"fieldOptions": {
"values": [
{
"option": "short"
},
{
"option": "medium"
},
{
"option": "long"
}
]
},
"requiredField": true
},
{
"fieldType": "number",
"fieldLabel": "Number of Videos",
"placeholder": "Enter number of videos to fetch (default 5)",
"requiredField": true
},
{
"fieldLabel": "Channel Name",
"placeholder": "Enter the YouTube channel name",
"requiredField": true
}
]
},
"formDescription": "Fetch trending videos from a specific channel"
},
"typeVersion": 2.2
},
{
"id": "eaf07791-3de3-4b28-86b7-d9d8c72540aa",
"name": "Set Parameters1",
"type": "n8n-nodes-base.set",
"position": [
208,
384
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"name": "api_key",
"type": "string",
"value": ""
},
{
"name": "format",
"type": "string",
"value": "={{ $json.Format }}"
},
{
"name": "videoLimit",
"type": "string",
"value": "={{ $json['Number of Videos'] }}"
},
{
"name": "channel_name",
"type": "string",
"value": "={{ $json['Channel Name'] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "554048e6-db9b-4039-8a3f-e1223535581d",
"name": "Get Channel ID1",
"type": "n8n-nodes-base.httpRequest",
"position": [
416,
384
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/search",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "part",
"value": "snippet"
},
{
"name": "type",
"value": "channel"
},
{
"name": "q",
"value": "={{ $json.channel_name }}"
},
{
"name": "key",
"value": "Use your Api Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "d7f5e607-d8a7-4e0e-aeba-70ce0d0c605e",
"name": "Extract Channel ID1",
"type": "n8n-nodes-base.code",
"position": [
592,
384
],
"parameters": {
"jsCode": "return [{ json: { channelId: $json.items[0].id.channelId } }];"
},
"typeVersion": 2
},
{
"id": "568257fb-7ebf-49ae-a2c2-b694554898e3",
"name": "Get Video IDs1",
"type": "n8n-nodes-base.httpRequest",
"position": [
832,
384
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/search",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "part",
"value": "snippet"
},
{
"name": "maxResults",
"value": "={{ $json.videoLimit || 5 }}"
},
{
"name": "order",
"value": "viewCount"
},
{
"name": "channelId",
"value": "={{ $json.channelId }}"
},
{
"name": "type",
"value": "video"
},
{
"name": "videoDuration",
"value": "={{ $json.format }}"
},
{
"name": "key",
"value": "Use your key"
},
{
"name": "regionCode",
"value": "US"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "5990323f-71c3-47b1-9c90-1223447b708c",
"name": "Extract IDs1",
"type": "n8n-nodes-base.code",
"position": [
1008,
384
],
"parameters": {
"jsCode": "const items = $input.all();\nreturn items.flatMap(item => (item.json?.items || []).map(videoItem => ({ json: { videoid: videoItem?.id?.videoId || null } })));\n"
},
"typeVersion": 2
},
{
"id": "f6ea02fe-25c9-4a84-896f-f439ff4f07d5",
"name": "Get Video Data1",
"type": "n8n-nodes-base.httpRequest",
"position": [
1216,
384
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/videos",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "part",
"value": "snippet,statistics"
},
{
"name": "id",
"value": "={{ $json.videoid }}"
},
{
"name": "key",
"value": "Use your Youtube Api"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "5fea0e50-6af3-46ff-80ff-10d0e76f1963",
"name": "Extract Video Data1",
"type": "n8n-nodes-base.code",
"position": [
1408,
384
],
"parameters": {
"jsCode": "const items = $input.all();\nreturn items.flatMap(item =>\n (item.json?.items || []).map(videoItem => ({\n json: {\n channelTitle: videoItem.snippet?.channelTitle || '',\n title: videoItem.snippet?.title || '',\n description: videoItem.snippet?.description || '', // ⬅️ added\n viewCount: videoItem.statistics?.viewCount || 0,\n likeCount: videoItem.statistics?.likeCount || 0,\n commentCount: videoItem.statistics?.commentCount || 0,\n videoURL: `https://www.youtube.com/watch?v=${videoItem.id || ''}`,\n thumbnail: videoItem.snippet?.thumbnails?.high?.url || ''\n }\n }))\n);\n"
},
"typeVersion": 2
},
{
"id": "8291de16-4e04-43dc-a5b2-b3f2c104be54",
"name": "Video Performance1",
"type": "n8n-nodes-base.code",
"position": [
1792,
384
],
"parameters": {
"jsCode": "const items = $input.all();\nreturn items.map(item => {\n const viewCount = parseInt(item.json.viewCount || '0', 10);\n const likeCount = parseInt(item.json.likeCount || '0', 10);\n const commentCount = parseInt(item.json.commentCount || '0', 10);\n let performance = 0;\n if (viewCount > 0) {\n performance = ((likeCount + commentCount) / viewCount) * 100;\n }\n return { json: { ...item.json, performance: performance.toFixed(2) } };\n});"
},
"typeVersion": 2
},
{
"id": "c1053470-9136-4c9e-a492-dbfe207fa869",
"name": "Append row in sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
2032,
384
],
"parameters": {
"columns": {
"value": {
"hook": "={{ $json.hook }}",
"title": "={{ $json.title }}",
"videoURL": "={{ $json.videoURL }}",
"likeCount": "={{ $json.likeCount }}",
"thumbnail": "={{ $json.thumbnail }}",
"viewCount": "={{ $json.viewCount }}",
"description": "={{ $json.description }}",
"performance": "={{ $json.performance }}",
"channelTitle": "={{ $json.channelTitle }}",
"commentCount": "={{ $json.commentCount }}"
},
"schema": [
{
"id": "channelTitle",
"type": "string",
"display": true,
"required": false,
"displayName": "channelTitle",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "description",
"type": "string",
"display": true,
"required": false,
"displayName": "description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "viewCount",
"type": "string",
"display": true,
"required": false,
"displayName": "viewCount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "likeCount",
"type": "string",
"display": true,
"required": false,
"displayName": "likeCount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "commentCount",
"type": "string",
"display": true,
"required": false,
"displayName": "commentCount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "videoURL",
"type": "string",
"display": true,
"required": false,
"displayName": "videoURL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "thumbnail",
"type": "string",
"display": true,
"required": false,
"displayName": "thumbnail",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "hook",
"type": "string",
"display": true,
"required": false,
"displayName": "hook",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "performance",
"type": "string",
"display": true,
"required": false,
"displayName": "performance",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1muc55xphO5rYn6uO1rxfb_-W1xruMIcFmbQE6EPRFBQ/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1muc55xphO5rYn6uO1rxfb_-W1xruMIcFmbQE6EPRFBQ/edit?usp=drivesdk",
"cachedResultName": "YouTube Viral Videos"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "UwnixXxqC0pFVvLS",
"name": "My Account"
}
},
"typeVersion": 4.6
},
{
"id": "201adcea-9f77-4a32-8cd6-e47d750d8b36",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-48,
320
],
"parameters": {
"width": 384,
"height": 224,
"content": "## Write the Channel name\n"
},
"typeVersion": 1
},
{
"id": "07eee8a6-6ec2-43b9-8603-9a43e2e53976",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
352,
320
],
"parameters": {
"color": 6,
"width": 400,
"height": 224,
"content": "## Get Channel ID's\n"
},
"typeVersion": 1
},
{
"id": "f3995972-de6a-45a5-8c07-b9da4e82c40e",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
768,
320
],
"parameters": {
"color": 4,
"width": 400,
"height": 224,
"content": "## Get Video ID's\n"
},
"typeVersion": 1
},
{
"id": "b912ba40-864b-4244-bcb8-c9a5ff854fd0",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1184,
304
],
"parameters": {
"width": 736,
"height": 272,
"content": "## Extract the video data Like Views , Likes , Title & Description "
},
"typeVersion": 1
},
{
"id": "1d538749-fe4c-4fa1-bffa-3cd40aac2cc3",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1952,
320
],
"parameters": {
"color": 3,
"width": 288,
"height": 240,
"content": "## Save Data in a Sheet"
},
"typeVersion": 1
},
{
"id": "8a65fcbf-3734-4abb-9991-73015894cab2",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
576,
80
],
"parameters": {
"color": 4,
"width": 752,
"height": 144,
"content": "# Get Viral videos data of your Competitor"
},
"typeVersion": 1
},
{
"id": "2b71d06b-99dd-4dab-b022-b70e311029d7",
"name": "Hook and Description",
"type": "n8n-nodes-base.code",
"position": [
1584,
384
],
"parameters": {
"jsCode": "const items = $input.all();\nreturn items.map(item => {\n const desc = item.json.description || \"\";\n // take the first 15 words of description as a \"hook\"\n const hook = desc.split(\" \").slice(0, 15).join(\" \");\n \n return {\n json: {\n ...item.json,\n hook\n }\n };\n});\n"
},
"typeVersion": 2
},
{
"id": "4de94c83-21aa-498b-8eec-14f42ecff894",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-832,
96
],
"parameters": {
"width": 768,
"height": 768,
"content": "# Get Viral Videos Data of Your Competitor\n\n## This workflow automatically extracts YouTube competitor video data.\nEnter a channel name → it fetches the channel ID, gathers recent video data (views, likes, titles, descriptions), and saves it to your Google Sheet.\n\n# Steps:\n\nOn form submission, provide a YouTube channel name.\n\nThe workflow finds its Channel ID.\n\nIt retrieves all recent Video IDs.\n\nExtracts key video metrics (Views, Likes, Title, Description).\n\nAppends the data to your Google Sheet for tracking.\n\n# Use Cases:\n\nAnalyze competitors’ most engaging videos.\n\nSpot trends before they go viral.\n\nTrack performance metrics over time.\n\n💡 Tip: You can extend it by adding an OpenAI node to summarize top-performing videos or find content patterns automatically."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "a7671256-6235-4271-aff4-be36e1023da7",
"connections": {
"Extract IDs1": {
"main": [
[
{
"node": "Get Video Data1",
"type": "main",
"index": 0
}
]
]
},
"Get Video IDs1": {
"main": [
[
{
"node": "Extract IDs1",
"type": "main",
"index": 0
}
]
]
},
"Get Channel ID1": {
"main": [
[
{
"node": "Extract Channel ID1",
"type": "main",
"index": 0
}
]
]
},
"Get Video Data1": {
"main": [
[
{
"node": "Extract Video Data1",
"type": "main",
"index": 0
}
]
]
},
"Set Parameters1": {
"main": [
[
{
"node": "Get Channel ID1",
"type": "main",
"index": 0
}
]
]
},
"Video Performance1": {
"main": [
[
{
"node": "Append row in sheet1",
"type": "main",
"index": 0
}
]
]
},
"Extract Channel ID1": {
"main": [
[
{
"node": "Get Video IDs1",
"type": "main",
"index": 0
}
]
]
},
"Extract Video Data1": {
"main": [
[
{
"node": "Hook and Description",
"type": "main",
"index": 0
}
]
]
},
"On form submission1": {
"main": [
[
{
"node": "Set Parameters1",
"type": "main",
"index": 0
}
]
]
},
"Hook and Description": {
"main": [
[
{
"node": "Video Performance1",
"type": "main",
"index": 0
}
]
]
}
}
}

في محرر n8n: الصق باستخدام Ctrl+Vسيتم إنشاء سير العمل