Daily YouTube channel stats log to Google Sheets

By General Input

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.

Integrations

  • YouTube
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Marketing
  • Operations

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.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats