Daily YouTube channel stats log to Google Sheets
Every night at 11pm, log views, likes, comments, and duration for every video on your channel to a Google Sheet so you can chart growth over time.
Build a deterministic daily log of every video on my YouTube channel so I have a historical performance table I can chart and pivot in Google Sheets. No AI, no summarization, no judgement calls. Just a clean nightly snapshot.
Trigger: cron, every day at 11pm in my local timezone.
Steps:
1. YouTube List Channels with mine=true to get my channel and read the uploads playlist ID from contentDetails.relatedPlaylists.uploads.
2. YouTube List Playlist Items against that uploads playlist ID, paginating through every page until nextPageToken is absent. Collect all video IDs.
3. YouTube Get Video in batches of up to 50 IDs per call, requesting part=snippet,statistics,contentDetails. This keeps quota usage low even for channels with hundreds of videos.
4. For each video, Google Sheets Append Values to add one row to my channel KPI sheet with these columns in order: today's date (YYYY-MM-DD in my local timezone), video ID, title, published date, view count, like count, comment count, and duration (ISO 8601 from contentDetails.duration is fine). Append, do not overwrite. Every run adds a fresh batch of rows tagged with today's date so the sheet becomes a time series.
5. Slack Send a Message to my chosen channel with a one-line confirmation: "Logged N videos to the channel KPI sheet" plus the spreadsheet link.
Notes for the build: batch the Google Sheets appends where possible so we are not making one API call per video. Handle YouTube pagination correctly (stop only when nextPageToken is missing). If a video is missing a statistic (for example, comments disabled or likes hidden), write an empty cell rather than failing the whole run. Surface a clear error in the Slack message if any step fails so I know the snapshot did not complete.
Additional information
What does this prompt do?
- Snapshots every video on your YouTube channel once a day so you build a clean time-series history of views, likes, comments, and duration.
- Appends one row per video to a Google Sheet with today's date, video title, published date, and all the core stats. No overwriting, no judgement calls, just a deterministic log.
- Posts a short Slack confirmation each night with the number of videos logged and a link to the spreadsheet so you know it ran.
- Built for channels with hundreds of videos. Pages through every upload and batches stat lookups so it stays well inside YouTube's daily quota.
What do I need to use this?
- A YouTube account for the channel you want to track, connected with read access.
- A Google Sheet where the daily rows will be appended, plus a Google account that can write to it.
- A Slack workspace and a channel where the nightly confirmation should post.
How can I customize it?
- Change the run time. 11pm local is the default, but you can pick any time of day or run it weekly instead.
- Choose which stats get logged. Drop columns you do not care about, or add tags, category, or thumbnail URL to the row.
- Swap the destination. Send the confirmation to a different Slack channel, or skip Slack and send an email summary instead.
Frequently asked questions
Will this work for a channel with hundreds of videos?
Does it overwrite yesterday's numbers?
Can I track a channel I do not own?
What if I want a weekly snapshot instead of daily?
Does this use AI to summarize the data?
Stop manually copying YouTube stats into a spreadsheet.
Connect YouTube, Google Sheets, and Slack once, and Geni logs your full channel every night so the data is ready when you are.