YouTube to Google Sheets, stats logged without errors
You know the drill. Someone drops a list of YouTube URLs into a sheet, and now you’re stuck opening tabs, copying view counts, pasting numbers, and hoping nothing shifts one row down.
This YouTube Sheets automation hits content strategists first, but growth marketers tracking competitors and small teams running weekly reporting feel it too. You get clean, repeatable stats logging (with a “Finished” or “Error” status per URL) without babysitting the process.
Below, you’ll see how the workflow runs, what it changes day-to-day, and how to set it up in a way that stays reliable when your list grows.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: YouTube to Google Sheets, stats logged without errors
flowchart LR
subgraph sg0["When clicking ‘Test workflow’ Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking ‘Test workflow’", pos: "b", h: 48 }
n1@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If - Check Success Response", pos: "b", h: 48 }
n2@{ icon: "mdi:database", form: "rounded", label: "Google Sheets - Update Data", pos: "b", h: 48 }
n3@{ icon: "mdi:database", form: "rounded", label: "Google Sheets - Update Data ..", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>HTTP - Find Video Data"]
n5@{ icon: "mdi:database", form: "rounded", label: "Google Sheets - Get Video URLs", pos: "b", h: 48 }
n6@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items", pos: "b", h: 48 }
n6 --> n4
n4 --> n1
n2 --> n6
n1 --> n2
n1 --> n3
n5 --> n6
n0 --> n5
n3 --> n6
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n1 decision
class n2,n3,n5 database
class n4 api
classDef customIcon fill:none,stroke:none
class n4 customIcon
The Challenge: Logging YouTube stats without messy spreadsheets
Tracking YouTube performance sounds simple until you do it at scale. A “quick check” becomes a weekly ritual of opening 20 videos, copying a handful of metrics, pasting them into the right row, and then second-guessing everything when one URL redirects or a number doesn’t match what you saw yesterday. The worst part is the mental load. You can’t focus on analysis because you’re busy verifying basic data entry. And if you’re doing competitor research, the list never stops growing, which means the busywork never stops either.
It adds up fast. Here’s where it breaks down in real teams.
- Manual copy-paste turns into about 2 hours of low-value work every week once you track more than a few videos.
- One misaligned paste can corrupt an entire report, so you end up rechecking rows instead of making decisions.
- Without a clear status like “Finished” or “Error,” you don’t know what’s complete and what quietly failed.
- Teams delay updates because it’s annoying work, which means you’re always looking at stale numbers.
The Fix: Auto-fetch YouTube video stats into Google Sheets
This n8n workflow takes a simple input (a list of YouTube URLs in Google Sheets) and turns it into a repeatable stats pipeline. You mark rows as “Ready,” run the workflow, and it loops through each URL in batches. For every video, it extracts the video ID, calls the YouTube API, and checks if the response came back clean. When it works, the workflow writes metrics like title, views, likes, and comment count into the same row and flips the status to “Finished.” If something fails, it doesn’t guess. It marks that row as “Error” so you can fix the URL, permissions, or API issue later without losing your place.
The workflow starts with a manual run in n8n (Execute or Test). Google Sheets supplies the URLs and statuses, the HTTP request pulls stats from YouTube, and an If check decides which update path to take. In the end, your sheet becomes the source of truth instead of a fragile scratchpad.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you track 40 videos each week for a content audit. Manually, even a quick routine (open the URL, find stats, paste into the right cells, and sanity-check the row) is about 3 minutes per video, so you’re spending roughly 2 hours weekly. With this workflow, you paste URLs once, set the status to Ready, and run it. The “work” is more like 5 minutes of setup plus waiting for the API calls to finish, and the sheet tells you exactly what succeeded.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets to store URLs, metrics, and statuses.
- YouTube Data API to fetch video statistics by ID.
- Google Cloud credentials (create in Google Cloud Console for Sheets + YouTube access).
Skill level: Beginner. You’ll connect Google accounts, enable an API, and paste a sheet ID/tab name into the right places.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
Manual run from n8n. You click Execute Workflow (or Test) when you want to refresh stats. If you prefer, you can later swap this for a Google Sheets trigger that runs when new rows appear.
Pull “Ready” URLs from Google Sheets. The workflow reads the “Video URLs” tab and filters down to rows marked Ready so you don’t reprocess old items.
Fetch metrics from YouTube. It loops through rows in batches, extracts the video ID from each URL, then makes an HTTP request to the YouTube API for the stats you care about.
Write results back with a clear status. A success path updates the row with metrics and sets the status to Finished. A failure path marks the row Error, which keeps your list clean and reviewable.
You can easily modify which fields you store (for example tags or category ID) based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Set the workflow to start on demand so you can run updates whenever you need fresh video metrics.
- Add or confirm the Manual Execution Start node as the trigger.
- Leave default settings, as this node has no parameters to configure.
- Ensure the main flow connects from Manual Execution Start to Retrieve Sheet Video Links.
Step 2: Connect Google Sheets
Pull the list of video URLs marked as ready from your spreadsheet.
- Open Retrieve Sheet Video Links and select the spreadsheet Document with ID
1I9gyb27WiRHz--g-xi-QH1W3WppZJdSfY6L32-DyUw0. - Set the Sheet to
Video Urls. - Under filters, set status to
readyso only queued rows are processed. - Credential Required: Connect your googleSheetsOAuth2Api credentials.
Step 3: Set Up Batch Processing and API Call
Process rows one at a time and fetch metadata for each YouTube URL.
- Open Batch Through Records and keep default settings to iterate through items.
- In YouTube API Request, set URL to
https://www.googleapis.com/youtube/v3/videos?. - Enable Send Query and add the following query parameters: id set to
{{ $json.video_url.match(/(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/)[1] }}, and part set tocontentDetails,snippet,statistics. - Set Authentication to
predefinedCredentialTypeand confirm nodeCredentialType isyouTubeOAuth2Api. - Credential Required: Connect your youTubeOAuth2Api credentials.
Step 4: Configure Output Updates to Google Sheets
Write the fetched video metrics back into the sheet for each row.
- In Verify API Response, keep the condition that checks
{{ $json.pageInfo.totalResults }}exists to validate a successful response. - Open Update Sheet Metrics and set Operation to
update. - Confirm Matching Columns includes row_number and is mapped to
{{ $('Retrieve Sheet Video Links').item.json.row_number }}. - Map output columns to the YouTube response: title to
{{ $json.items[0].snippet.title }}, tags to{{ $json.items[0].snippet.tags.join(", ") }}, view_count to{{ $json.items[0].statistics.viewCount }}, like_count to{{ $json.items[0].statistics.likeCount }}, comment_count to{{ $json.items[0].statistics.commentCount }}, published_at to{{ $json.items[0].snippet.publishedAt.toString().slice(0, 19).replace('T', ' ') }}, and last_fetched_time to{{ $now.toISO().toString().slice(0, 19).replace('T', ' ') }}. - Credential Required: Connect your googleSheetsOAuth2Api credentials.
Step 5: Add Error Handling
Flag records that fail the API response check and continue processing the next item.
- Use Verify API Response to route unsuccessful results to Mark Sheet Error.
- In Mark Sheet Error, set Operation to
updateand map status toerror. - Map row_number to
{{ $('Retrieve Sheet Video Links').item.json.row_number }}and last_fetched_time to{{ $now.toISO().toString().slice(0, 19).replace('T', ' ') }}. - Credential Required: Connect your googleSheetsOAuth2Api credentials.
Final Step: Test and Activate Your Workflow
Run a manual test and then turn on the workflow for production use.
- Click Execute Workflow to trigger Manual Execution Start.
- Verify that rows with status set to
readyare updated with titles, counts, and timestamps in Update Sheet Metrics. - Confirm any invalid or missing video IDs are marked
errorby Mark Sheet Error. - When results look correct, toggle the workflow to Active for ongoing use.
Watch Out For
- Google Cloud credentials can expire or lack the right scopes. If the Google Sheets update nodes start failing, check the credential settings in n8n and confirm the sheet is shared with the connected account.
- YouTube Data API quotas are real. If you run huge batches or refresh too frequently, you may hit quota limits and see more rows marked Error until the quota resets.
- The URL formats vary (short links, playlists, extra parameters). If some videos fail, make sure your video ID extraction handles the URL patterns your team pastes in.
Common Questions
About 30 minutes if your Google Cloud project is ready.
Yes, but someone needs to handle the Google Cloud Console setup once. After that, day-to-day use is just adding URLs and setting rows to Ready.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in YouTube Data API usage (usually covered by free quota for light reporting).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
You can expand the HTTP – Find Video Data request to pull additional fields like tags or category ID, then map them into new columns in the Google Sheets update node. Many teams also replace the manual trigger with a Google Sheets trigger so new “Ready” rows kick off processing automatically. If you’re tracking competitors, adding a “Channel” column per row makes filtering and pivot tables much easier.
Usually it’s an expired or mis-scoped Google credential in n8n. Reconnect the Google Sheets credential, confirm the spreadsheet is shared with that Google account, and double-check the node is pointing at the correct tab (“Video URLs”).
If you self-host, capacity mostly comes down to your server and YouTube API quota, not n8n itself. On n8n Cloud, your monthly execution limit depends on plan, and each video processed counts toward that total. Practically, this workflow can handle long lists because it runs in batches; the main constraint is how aggressively you’re calling the YouTube API.
Often, yes. Zapier and Make can do basic “URL in, row out” workflows, but handling batching, branching on API failures, and reprocessing only the “Ready” rows gets fiddly and can become expensive as volume grows. n8n is more forgiving here because you can loop through items, add logic checks, and keep the whole thing in one workflow. If you self-host, you also avoid paying more just because you ran more updates this month. That said, if you only ever track five videos at a time, Zapier can be quicker to set up. Talk to an automation expert if you want an honest recommendation for your situation.
Once this is running, your sheet stays clean and your reporting stops being fragile. The workflow handles the repetitive checking and logging, so you can spend your time actually interpreting what the numbers mean.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.