
YouTube Trends Finder
説明
Categories
📢 Marketing🤖 AI & Machine Learning
Nodes Used
n8n-nodes-base.ifn8n-nodes-base.ifn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.coden8n-nodes-base.formn8n-nodes-base.noOpn8n-nodes-base.noOpn8n-nodes-base.youTube
Price無料
Views0
最終更新11/28/2025
workflow.json
{
"id": "SYrpMRFFGu2Y96eE",
"meta": {
"instanceId": "061ca141d020a6e1355b8c7fe05f92a699e37e92079ad2e150a506ee8bbe9e11"
},
"name": "YouTube Trends Finder",
"tags": [],
"nodes": [
{
"id": "c3c3a2c0-e066-4e6f-94d3-54d10c72b588",
"name": "Get many videos",
"type": "n8n-nodes-base.youTube",
"position": [
-1104,
176
],
"parameters": {
"filters": {
"q": "={{ $('On form submission').item.json['Topic Name'] }}",
"regionCode": "US",
"publishedAfter": "={{ $('Edit Fields').item.json[\"Published After\"] }}"
},
"options": {
"order": "relevance",
"safeSearch": "moderate"
},
"resource": "video",
"returnAll": true
},
"typeVersion": 1
},
{
"id": "a6f66df7-33f7-44c6-90a0-2cc050d59561",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
-1616,
176
],
"webhookId": "b29d3aa8-6546-4971-9326-918ff3a3f4a6",
"parameters": {
"options": {},
"formTitle": "Find YT Trends in Your Niche",
"formFields": {
"values": [
{
"fieldLabel": "Topic Name",
"requiredField": true
},
{
"fieldType": "number",
"fieldLabel": "Last How Many Days?",
"requiredField": true
}
]
},
"responseMode": "lastNode",
"formDescription": "Put the Niche Name and Get The Trends"
},
"typeVersion": 2.2
},
{
"id": "f6d8d02b-2f65-4eb8-96f9-e5d3162b4a1e",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
-1456,
176
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c4122b37-8a0e-4cc6-aa0d-c43e6eecd97f",
"name": "Published After",
"type": "string",
"value": "={{ $today.minus({days: $json['Last How Many Days?']}).toFormat('yyyy-MM-dd\\'T\\'HH:mm:ss') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "3da1c044-113a-453a-9b06-bba96172b040",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
-736,
176
],
"parameters": {
"jsCode": "const items = $input.all();\n\nconst engagementRates = items.map((item) => {\n const video = item.json.items?.[0];\n const stats = video?.statistics || {};\n\n const likeCount = parseInt(stats.likeCount || 0, 10);\n const commentCount = parseInt(stats.commentCount || 0, 10);\n const viewCount = parseInt(stats.viewCount || 0, 10);\n\n let engagementRate = 0;\n if (viewCount > 0) {\n engagementRate = ((likeCount + commentCount) / viewCount) * 100;\n }\n\n return {\n json: {\n id: video?.id || null,\n title: video?.snippet?.title || null,\n engagementRate: engagementRate.toFixed(2),\n viewCount,\n likeCount,\n commentCount\n }\n };\n});\n\nreturn engagementRates;\n"
},
"typeVersion": 2
},
{
"id": "0c8ea224-c476-4c92-8177-8d3016961057",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
-384,
352
],
"parameters": {},
"typeVersion": 1
},
{
"id": "01f702ce-2284-4a60-a1b9-4741ee60c45c",
"name": "Create spreadsheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1280,
176
],
"parameters": {
"title": "=Trending YouTube Videos on {{ $('On form submission').item.json['Topic Name'] }} in Last {{ $('On form submission').item.json['Last How Many Days?'] }} days",
"options": {},
"resource": "spreadsheet"
},
"typeVersion": 4.7
},
{
"id": "dddb8081-289f-4e9c-aa02-5294e6f97267",
"name": "Append row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
192,
0
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "Video Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Video Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Video URL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Video URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Views",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Views",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Likes",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Likes",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Comments",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Uploaded",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Uploaded",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"cellFormat": "USER_ENTERED"
},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TCVpJwGN_2oBrVXmtsdGOQgPxyvYSlyoC51sLu28mHk/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Create spreadsheet').item.json.spreadsheetId }}"
}
},
"typeVersion": 4.7
},
{
"id": "2dd50913-5321-48db-a2b8-bda94b9b3966",
"name": "Form",
"type": "n8n-nodes-base.form",
"position": [
544,
0
],
"webhookId": "faa830fb-63b6-42cc-812d-0d9974331f6a",
"parameters": {
"options": {},
"operation": "completion",
"completionTitle": "🤖 Here's Your Analytics Data 🔽",
"completionMessage": "={{ $json.OutPut }}"
},
"typeVersion": 1
},
{
"id": "266d7470-d1b5-4696-99d3-cc3fd0f8eb58",
"name": "No Operation, do nothing1",
"type": "n8n-nodes-base.noOp",
"position": [
0,
192
],
"parameters": {},
"typeVersion": 1
},
{
"id": "3159c4f3-4298-404b-a267-190e1ba10370",
"name": "Get Data",
"type": "n8n-nodes-base.httpRequest",
"position": [
-912,
176
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/videos?",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "key",
"value": "=Your Project API Key"
},
{
"name": "part",
"value": "contentDetails, snippet, statistics"
},
{
"name": "id",
"value": "={{ $json.id.videoId }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "aaf45b82-6f3b-4efa-858e-f3f511303457",
"name": "Data Format",
"type": "n8n-nodes-base.set",
"position": [
-384,
16
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "4df5f7b5-9a62-4e56-89bd-5f32dea0afe5",
"name": "Video Title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "e95a1103-f1fd-45e7-99d6-5a345d63059b",
"name": "Video URL",
"type": "string",
"value": "=https://www.youtube.com/watch?v={{ $json.id }}"
},
{
"id": "c56731ba-aa34-4d77-ac4a-351023cfe307",
"name": "Engagement Rate",
"type": "string",
"value": "={{ $json.engagementRate }}"
},
{
"id": "9f3b4cf0-ac26-4e91-a57c-4642039a53ac",
"name": "Views",
"type": "string",
"value": "={{ $json.viewCount }}"
},
{
"id": "8c9098a1-942e-4545-bee0-9bbe8b896858",
"name": "Likes",
"type": "string",
"value": "={{ $json.likeCount }}"
},
{
"id": "4e3e4a3b-27f1-4eef-8bb8-68303753f9e1",
"name": "Comments",
"type": "string",
"value": "={{ $json.commentCount }}"
},
{
"id": "df17f506-d404-4fdd-afb1-0ee28e46acb9",
"name": "Uploaded Hours Ago",
"type": "string",
"value": "={{ (() => { const published = new Date($('Get Data').item.json.items[0].snippet.publishedAt); const now = new Date(); const diffMs = now - published; const diffHours = Math.floor(diffMs / (1000 * 60 * 60)); return diffHours; })() }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1951fa3a-af44-4b4a-9bf0-64da6da127c3",
"name": "Output Format",
"type": "n8n-nodes-base.set",
"position": [
368,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "994aa092-5c08-466a-9628-bd59d05c10ad",
"name": "OutPut",
"type": "string",
"value": "=\nhttps://docs.google.com/spreadsheets/d/{{ $('Create spreadsheet').item.json.spreadsheetId }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f59b4bb6-68ba-4b45-bb8d-736477881bd2",
"name": "Engagement Rate Check",
"type": "n8n-nodes-base.if",
"position": [
-592,
176
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "7da3c1db-d75e-4b62-a78b-846d8e94a701",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.engagementRate }}",
"rightValue": 2
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "c0bb6380-f7c6-44d0-8207-2ce40a3adf9d",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-240,
16
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "5c84431b-3683-4309-a1a8-d16613de2e5b",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.Views }}",
"rightValue": 1000
},
{
"id": "e810a539-4cd7-4603-b559-6e85e2fea8aa",
"operator": {
"type": "number",
"operation": "lte"
},
"leftValue": "={{ $json['Uploaded Hours Ago'] }}",
"rightValue": "={{ $('On form submission').item.json['Last How Many Days?'] * 24 }}"
},
{
"id": "246da16f-70c1-441f-990d-185a3a01834e",
"operator": {
"type": "string",
"operation": "notContains"
},
"leftValue": "={{ $json['Video Title'] }}",
"rightValue": "#"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "95b5f253-1140-4dfd-b3a6-bb0c64abff20",
"name": "Remove Duplicates",
"type": "n8n-nodes-base.removeDuplicates",
"position": [
0,
0
],
"parameters": {
"compare": "selectedFields",
"options": {},
"fieldsToCompare": "['Video URL']"
},
"typeVersion": 2
},
{
"id": "e26341d6-d21c-41ca-bfa1-21f7498d3b43",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1552,
-496
],
"parameters": {
"color": 6,
"width": 912,
"height": 576,
"content": "---\n# 🛠 Setup Guide\nFollow these steps to get started:\n1. **Set up the Trend Finder Form**\n Customize the form fields (Topic Name, Last How Many Days) in the **Form Trigger** node. This is how users input their niche and time range for trend analysis.\n\n2. **Connect your [YouTube Data API](https://developers.google.com/youtube/v3)**\n Add your YouTube OAuth2 credentials in the **Get many videos** node and replace `Your Project API Key` in the **Get Data** HTTP Request node with your actual YouTube API key.\n\n3. **Link your [Google Sheets](https://docs.google.com/spreadsheets/) account**\n Connect your Google Sheets OAuth2 credentials in both the **Create spreadsheet** and **Append row in sheet** nodes to automatically generate trend reports.\n\n4. **Configure the Engagement Rate Filter**\n Adjust the engagement rate threshold (currently set to 2%) in the **Engagement Rate Check** node based on your quality standards.\n\n5. **Customize Video Filters**\n Modify the conditions in the **If** node to filter videos by minimum views (currently 1000+), time range, and exclude hashtag-heavy titles.\n\n6. **Set Regional Preferences**\n Update the `regionCode` parameter in the **Get many videos** node (currently \"US\") to target specific geographic regions.\n\nOnce all connections are set, your workflow will **analyze YouTube trends, filter high-engagement videos, and generate automated spreadsheet reports** 🚀\n---"
},
"typeVersion": 1
},
{
"id": "15419c5b-5583-4204-8e7c-cec4a3290809",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
-496
],
"parameters": {
"color": 6,
"width": 480,
"height": 464,
"content": "## Start here: Step-by Step Youtube Tutorial :star:\n[](https://youtu.be/AIOmu5OwZMs?si=GlCPT5y6YW-yStb5)"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "254d16f7-3d61-4d3f-9628-f8ba8858ffd4",
"connections": {
"If": {
"main": [
[
{
"node": "Remove Duplicates",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing1",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Engagement Rate Check",
"type": "main",
"index": 0
}
]
]
},
"Get Data": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Data Format": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Create spreadsheet",
"type": "main",
"index": 0
}
]
]
},
"Output Format": {
"main": [
[
{
"node": "Form",
"type": "main",
"index": 0
}
]
]
},
"Get many videos": {
"main": [
[
{
"node": "Get Data",
"type": "main",
"index": 0
}
]
]
},
"Remove Duplicates": {
"main": [
[
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
},
"Create spreadsheet": {
"main": [
[
{
"node": "Get many videos",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet": {
"main": [
[
{
"node": "Output Format",
"type": "main",
"index": 0
}
]
]
},
"Engagement Rate Check": {
"main": [
[
{
"node": "Data Format",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
}
}