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.
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
Every morning, ClickRuntime lists the videos on your channel.
It fetches the current views, likes and comments for each one.
Each video's record in Airtable is updated, or created if it is new, matched by the video ID.
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
Build your own
Need it to work differently?
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
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?
Will it change fields my team uses?
Can it go back through old videos?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Publish the next ready video from your Airtable queue
On schedule, the next video marked ready in Airtable is uploaded to YouTube and its record is updated with the link.
See how it worksCollect new YouTube videos on your topics into Airtable
Each day, new videos on the topics you follow are summarised and saved as records in Airtable.
See how it worksTrack competitor YouTube channel stats in Airtable
Every Monday, each YouTube channel listed in an Airtable table gets a new row with subscribers, total views, video count and growth since last week.
See how it worksKeep exploring
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.