Skip to content

Daily

Keep your YouTube videos and stats in Airtable

Your Airtable base lists every video on your channel with its views, likes and comments, refreshed every day.

Runs
Daily
Apps
Airtable, YouTube
AI
Optional
Access
YouTube API key; Airtable write

Send this to your assistant

Create a ClickRuntime automation: every morning, update my Videos table in Airtable with every video on my channel and its current views, likes and comments, adding new videos and updating existing ones. Email me a short AI summary of what changed.

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

A content team plans videos in Airtable but checks performance in YouTube Studio. Linking the plan to the results means copying numbers across by hand, so nobody really knows which ideas performed well.

Keeping every video and its stats in the same base as the plan lets the team see results next to the topic, format and owner, and learn what to make next.

What you get out of it

  • Results next to the plan

    Views sit beside topic, format and owner, so you can group and compare in Airtable.

  • Always current

    Numbers refresh daily without anyone exporting from YouTube Studio.

  • One record per video

    Existing records are updated rather than duplicated, so the table stays tidy.

  • A short summary if you want it

    With AI on, a daily email points out the videos that moved most.

How it works

What happens, step by step

  1. Every morning, ClickRuntime lists the videos on your channel.

  2. It fetches the current views, likes and comments for each one.

  3. Each video's record in Airtable is updated, or created if it is new, matched by the video ID.

  4. If AI is available, you get a short email summary of which videos moved most.

Before it runs live

  • Connect Airtable
  • Connect YouTube

What you get

RunsDaily
Keep your YouTube videos and stats in Airtabletoday, 9:00Succeeded
Airtable · VideosPackaging teardown: Acme vs Northwind | 18,204 views | 611 likes | 94 comments

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
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Airtable 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.
sync_channel_videos_and_stats_into_airtable.pyexample
from clickruntime import on_trigger, http, credentials, ai, notify

YT = "https://www.googleapis.com/youtube/v3"

def yt(path, **params):
    return http.get(f"{YT}/{path}", params={**params, "key": credentials.secret("YOUTUBE_API_KEY")}).json().get("items", [])

AT = "https://api.airtable.com/v0/appXXXXXXXXXXXXXX"

def at(method, path, **kw):
    r = http.request(method, f"{AT}/{path}", headers={"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}, **kw)
    return r.raise_for_status() or r.json()

UPLOADS = "UUxxxxxxxxxxxxxxxxxxxxxx"

@on_trigger
def run(event):
    ids = [i["contentDetails"]["videoId"] for i in yt("playlistItems", part="contentDetails", playlistId=UPLOADS, maxResults=50)]
    records = []
    for v in yt("videos", part="snippet,statistics", id=",".join(ids)):
        s = v["statistics"]
        records.append({"fields": {"Video ID": v["id"], "Title": v["snippet"]["title"], "Published": v["snippet"]["publishedAt"][:10],
                        "Views": int(s.get("viewCount", 0)), "Likes": int(s.get("likeCount", 0)), "Comments": int(s.get("commentCount", 0))}})
    for i in range(0, len(records), 10):
        at("PATCH", "Videos", json={"performUpsert": {"fieldsToMergeOn": ["Video ID"]}, "records": records[i:i + 10]})
    try:
        top = sorted(records, key=lambda r: -r["fields"]["Views"])[:10]
        note = ai.generate("\n".join(f"{r['fields']['Title']}: {r['fields']['Views']} views" for r in top),
                           system="In 3 sentences, summarise how these videos are doing.", max_output_tokens=150).text
        notify.email_me("YouTube stats updated in Airtable", note)
    except ai.AIError:
        pass
    return {"synced": len(records)}

FAQ

Common questions

How does it match videos to records?
By the YouTube video ID, stored in a field on each record. New videos get new records.
Will it change fields my team uses?
Only the stats fields and title. Your planning fields are left alone.
Can it go back through old videos?
Yes. The first run adds every video in your uploads list.
What permissions does it need?
YouTube API key; Airtable write. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run each time it runs (daily). 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 “Keep your YouTube videos and stats in Airtable” from your assistant

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