This workflow corresponds to n8n.io template #5766 — we link there as the canonical source.
This workflow follows the Google Sheets → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "9I7wnSTl7wvPjxZQ",
"name": "Youtube - Get Video Statistics",
"tags": [
{
"id": "CEVEeZJa4qgPvdpK",
"name": "youtube",
"createdAt": "2025-05-27T02:29:43.874Z",
"updatedAt": "2025-05-27T02:29:43.874Z"
}
],
"nodes": [
{
"id": "de9aba98-7d3d-4de0-bcb2-020abe4775be",
"name": "When clicking \u2018Test workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-700,
420
],
"parameters": {},
"typeVersion": 1
},
{
"id": "05f35e6b-52ec-4998-a3ff-99f92d70ac6d",
"name": "If - Check Success Response",
"type": "n8n-nodes-base.if",
"position": [
180,
120
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "bce76f94-5904-4fdb-b172-adc1134855f9",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.pageInfo.totalResults }}",
"rightValue": 200
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "98fdd444-47af-43a0-a8d4-9df561a3eabe",
"name": "Google Sheets - Update Data",
"type": "n8n-nodes-base.googleSheets",
"position": [
400,
120
],
"parameters": {
"columns": {
"value": {
"tags": "={{ $json.items[0].snippet.tags.join(\", \") }}",
"title": "={{ $json.items[0].snippet.title }}",
"status": "finish",
"duration": "={{ (d => d[1] ? `${d[1]}:${String(d[2] || 0).padStart(2, '0')}:${String(d[3] || 0).padStart(2, '0')}` : `${d[2] || 0}:${String(d[3] || 0).padStart(2, '0')}`)($json.items[0].contentDetails.duration.match(/PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?/)) }}\n",
"language": "={{ $json.items[0].snippet.defaultLanguage }}",
"channel_id": "={{ $json.items[0].snippet.channelId }}",
"like_count": "={{ $json.items[0].statistics.likeCount }}",
"row_number": "={{ $('Google Sheets - Get Video URLs').item.json.row_number }}",
"thumbnails": "={{ $json.items[0].snippet.thumbnails.default.url }}",
"view_count": "={{ $json.items[0].statistics.viewCount }}",
"description": "={{ $json.items[0].snippet.description }}",
"published_at": "={{ $json.items[0].snippet.publishedAt.toString().slice(0, 19).replace('T', ' ') }}",
"channel_title": "={{ $json.items[0].snippet.channelTitle }}",
"comment_count": "={{ $json.items[0].statistics.commentCount }}",
"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,
"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": "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": "thumbnails",
"type": "string",
"display": true,
"required": false,
"displayName": "thumbnails",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "tags",
"type": "string",
"display": true,
"required": false,
"displayName": "tags",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "duration",
"type": "string",
"display": true,
"required": false,
"displayName": "duration",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "view_count",
"type": "string",
"display": true,
"required": false,
"displayName": "view_count",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "like_count",
"type": "string",
"display": true,
"required": false,
"displayName": "like_count",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "comment_count",
"type": "string",
"display": true,
"required": false,
"displayName": "comment_count",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "language",
"type": "string",
"display": true,
"required": false,
"displayName": "language",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "published_at",
"type": "string",
"display": true,
"required": false,
"displayName": "published_at",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "channel_id",
"type": "string",
"display": true,
"required": false,
"displayName": "channel_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "channel_title",
"type": "string",
"display": true,
"required": false,
"displayName": "channel_title",
"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/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/edit#gid=426418282",
"cachedResultName": "Video Urls"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/edit?usp=drivesdk",
"cachedResultName": "Youtube - Get Video Statics"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 4.5
},
{
"id": "f0c76306-d47b-4442-935d-61a7c01bf0bc",
"name": "Google Sheets - Update Data - Error",
"type": "n8n-nodes-base.googleSheets",
"position": [
400,
320
],
"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,
"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": "title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "description",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "thumbnails",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "thumbnails",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "tags",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "tags",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "duration",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "duration",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "view_count",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "view_count",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "like_count",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "like_count",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "comment_count",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "comment_count",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "language",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "language",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "published_at",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "published_at",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "channel_id",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "channel_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "channel_title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "channel_title",
"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/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/edit#gid=426418282",
"cachedResultName": "Video Urls"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/edit?usp=drivesdk",
"cachedResultName": "Youtube - Get Video Statics"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 4.5
},
{
"id": "0c71b117-aeae-45d3-806d-9e89ef1ffb39",
"name": "HTTP - Find Video Data",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
-40,
145
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/videos?",
"options": {},
"sendQuery": true,
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "={{ $json.video_url.match(/(?:youtube(?:-nocookie)?\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?)\\/|\\S*?[?&]v=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/)[1] }}"
},
{
"name": "part",
"value": "contentDetails,snippet,statistics"
}
]
},
"nodeCredentialType": "youTubeOAuth2Api"
},
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.2,
"alwaysOutputData": false
},
{
"id": "e8e9b10e-0456-4c5b-855c-79602c0f9f9d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1580,
-160
],
"parameters": {
"width": 720,
"height": 1480,
"content": "## [Agent Circle's N8N Workflow] YouTube Video Statistics Crawler - Try It Out!\n\n**This N8N template makes it easy to extract key YouTube video data - including title, view count, like count, comment count, and many more - and save it directly into a connected Google Sheet.**\n\nUse cases are many: Whether you're **YouTubers**, **content strategists**, **growth marketers**, and **automation engineers**, this tool gives you fast, structured access to video-level insights in seconds.\n\n## How It Works\n- The workflow begins when you click **Execute Workflow** or **Test Workflow** manually in N8N.\n- It reads the list of video URLs in the connected Google Sheet. Only the URLs marked with the **Ready** status will be processed.\n- The tool loops through each video and prepares the necessary data for the YouTube API call later.\n- For each available URL, the tool extracts the video ID and sends a request to the YouTube API to fetch key metrics.\n- The response is checked:\n - **If successful**: the video\u2019s statistics are written back to the corresponding row in the Google Sheet and the row's status is marked as **Finished**.\n - **If unsuccessful**: the row's status is updated to **Error** for later review.\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 Statistics** Google Sheet template](https://docs.google.com/spreadsheets/d/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/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** \u2192 connected to Tab **Video URLs**;\n Node **Google Sheets - Update Data** \u2192 connected to Tab **Video URLs**;\n Node **Google Sheets - Update Data - Error** \u2192 connected to Tab **Video URLs**.\n + For YouTube access, set up a GET method to connect to YouTube API in the following node:\n Node **HTTP - Find Video Data**.\n- In your connected Google Sheet, enter the video URLs that you want to crawl and set the rows' status to **Ready**.\n- Run the workflow by clicking **Execute Workflow** or **Test Workflow** in N8N.\n- View the results in your connected Google Sheet: Successful fetches will update the rows' status in **Column A** in the **Video URLs** tab to **Finished** and the video metrics will populate. If the call fails, the rows' status in **Column A** in the tab will be marked as **Error**.\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 automatically.\n- If you want to fetch additional video fields or analytics (like tags, category ID, etc.), you can expand the **HTTP - Find Video Data** node to include those.\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": "b9e277aa-b307-4a75-997c-6ef319b13e28",
"name": "Google Sheets - Get Video URLs",
"type": "n8n-nodes-base.googleSheets",
"position": [
-480,
420
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "ready",
"lookupColumn": "status"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 426418282,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/edit#gid=426418282",
"cachedResultName": "Video Urls"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0/edit?usp=drivesdk",
"cachedResultName": "Youtube - Get Video Statics"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "331af5c0-428a-41a6-a9ca-268cf9b50da3",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-760,
-140
],
"parameters": {
"color": 7,
"width": 640,
"height": 800,
"content": "## 1. Read Video URLs from Google Sheets\n- We'll read all video URLs listed in your connected Google Sheet \u2013 typically from a tab named **Video URLs**. Only \n- The loop iterates over each row that's marked as **Ready** in the status **Column A** for processing."
},
"typeVersion": 1
},
{
"id": "9e1e2bb8-cf50-404f-a637-0f144b60af7f",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-100,
-140
],
"parameters": {
"color": 7,
"height": 800,
"content": "## 2. Fetch Video Statistics From YouTube API\nOnce a video URL is read, the workflow sends a request to the YouTube API to pull essential data for the corresponding video.\n"
},
"typeVersion": 1
},
{
"id": "295fa90d-029e-4b7d-a8e0-e40f8f791c0f",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
-140
],
"parameters": {
"color": 7,
"width": 500,
"height": 800,
"content": "## 3. Write Results Back To Google Sheets\n- The API response is validated, in the connected Google Sheet:\n - If successful: the video\u2019s statistics are filled into the corresponding row, and the row's status in **Column A** in the **Video URLs** tab is marked as **Finished**.\n - If unsuccessful: the row's status in **Column A** in the **Video URLs** tab is updated to **Error** for later review.\n- Then, the tool moves on to the next available video, if one exists."
},
"typeVersion": 1
},
{
"id": "e33bf702-f7c8-4174-aedb-6ac0db968a26",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-260,
420
],
"parameters": {
"options": {}
},
"typeVersion": 3
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "8f09f1fc-d50e-40c8-b0d8-9867f8b7f7c8",
"connections": {
"Loop Over Items": {
"main": [
[],
[
{
"node": "HTTP - Find Video Data",
"type": "main",
"index": 0
}
]
]
},
"HTTP - Find Video Data": {
"main": [
[
{
"node": "If - Check Success Response",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets - Update Data": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"If - Check Success Response": {
"main": [
[
{
"node": "Google Sheets - Update Data",
"type": "main",
"index": 0
}
],
[
{
"node": "Google Sheets - Update Data - Error",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets - Get Video URLs": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Test workflow\u2019": {
"main": [
[
{
"node": "Google Sheets - Get Video URLs",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets - Update Data - Error": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleSheetsOAuth2ApiyouTubeOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Use cases are many: Whether you're YouTubers, content strategists, growth marketers, and automation engineers, this tool gives you fast, structured access to video-level insights in seconds. The workflow begins when you click Execute Workflow or Test Workflow manually in N8N. It…
Source: https://n8n.io/workflows/5766/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n workflow automates the process of uploading video and image advertisements to Meta Ads Manager via the Meta Graph API (Facebook Ads) directly from Google Sheets and Google Drive. The workflow
This workflow provides an end-to-end automation for discovering, evaluating, and optionally downloading high-quality educational YouTube videos.
• Downloads videos/music from YouTube using yt-dlp • Merges assets with dynamic text overlays • Automatically uploads to YouTube as Shorts (9:16 format) • Tracks everything in Google Sheets Install yt
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
This workflow is perfect for digital content creators, marketers, and social media managers who regularly create engaging short-form videos featuring inspirational or motivational quotes. While the wo