Skip to content

On a schedule

Export YouTube video stats to Google Sheets

Every Sunday night a Videos tab is rewritten with every upload on the channel: title, publish date, duration, views, likes, comments and link.

Runs
On a schedule
Apps
Google Sheets, YouTube
AI
Not needed
Access
youtube.readonly; Google Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: every Sunday at 10pm, refresh the Videos tab of my sheet with all videos on my YouTube channel and their publish date, duration, views, likes, comments and link.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

YouTube Studio is built to look at one video or one period at a time. When you want to compare all your videos at once, such as long against short or this year's uploads against last year's, you need the numbers in a spreadsheet.

This automation rewrites a Videos tab every week with every upload on your channel, its publish date, length, views, likes and comments, sorted by views.

Creators planning their next videos, brand channel managers and agencies reporting to clients use it as their master list of videos.

What you get out of it

  • Every video in one table

    Compare all uploads at once rather than scrolling Studio.

  • Find what works

    Sort or filter by length, topic or year to see which formats get the most views.

  • Engagement side by side

    Likes and comments per view point to videos that connected with viewers.

  • Fresh every week

    The tab is rebuilt each Sunday, so numbers stay current.

  • Built on your channel login

    Your Google connection reads your own channel; no extra API keys are needed.

How it works

What happens, step by step

  1. Every Sunday night ClickRuntime finds your channel's uploads list.

  2. It goes through every video and fetches views, likes, comments and duration in batches of 50.

  3. The Videos tab is cleared and rewritten, most viewed first, with a link to each video.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect YouTube

What you get

RunsOn a schedule
Export YouTube video stats to Google Sheetstoday, 9:00Succeeded
Google Sheets · YouTube › VideosHow we bake 200 loaves before 6am | 2026-09-14 | 12:48 | 184,220 views | 6,103 likes | 412 comments | youtu.be/aB3…

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Sheets and YouTube steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
export_youtube_video_stats_to_google_sheets.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import re
from clickruntime import on_trigger, credentials, report_fetched

SHEET_ID = "your-spreadsheet-id"

def duration(iso):
    h, m, s = (int(x or 0) for x in re.match(r"PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?", iso).groups())
    return f"{h}:{m:02}:{s:02}" if h else f"{m}:{s:02}"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    yt = build("youtube", "v3", credentials=creds, cache_discovery=False)
    uploads = yt.channels().list(part="contentDetails", mine=True).execute()["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
    ids, token = [], None
    while True:
        page = yt.playlistItems().list(part="contentDetails", playlistId=uploads, maxResults=50, pageToken=token).execute()
        ids += [i["contentDetails"]["videoId"] for i in page["items"]]
        token = page.get("nextPageToken")
        if not token:
            break
    report_fetched(len(ids))
    rows = []
    for i in range(0, len(ids), 50):
        for v in yt.videos().list(part="snippet,statistics,contentDetails", id=",".join(ids[i:i + 50])).execute()["items"]:
            s = v["statistics"]
            rows.append([v["snippet"]["title"], v["snippet"]["publishedAt"][:10], duration(v["contentDetails"]["duration"]),
                         int(s.get("viewCount", 0)), int(s.get("likeCount", 0)), int(s.get("commentCount", 0)), f"https://youtu.be/{v['id']}"])
    rows.sort(key=lambda r: -r[3])
    tab = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values()
    tab.clear(spreadsheetId=SHEET_ID, range="Videos!A:G").execute()
    tab.update(spreadsheetId=SHEET_ID, range="Videos!A1", valueInputOption="RAW", body={"values": [
        ["Title", "Published", "Duration", "Views", "Likes", "Comments", "Link"]] + rows}).execute()
    return {"videos": len(rows)}

FAQ

Common questions

Does it include Shorts and private videos?
Shorts are included because they are uploads. Private and unlisted videos are included too, since you are reading your own channel; filter them out by asking for a privacy status column.
Will it use up my YouTube API quota?
No. Each call returns up to 50 videos at 1 quota unit, so even a channel with a thousand videos uses a few dozen units out of the default daily 10,000.
Can it keep weekly history per video?
Yes. Ask your assistant to also append the date and views per video to a second tab, so you can chart how each video grows.
What permissions does it need?
youtube.readonly; Google Sheets read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Export YouTube video stats to Google Sheets” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.