Tutorial
How to Make a YouTube Video That Updates Its OWN Title
Yes, you read that right. The title changes. Automatically. Forever. And it costs exactly $0.
Title:
This YouTube video has exactly 0 views
The Idea
What if your YouTube video's title always showed its exact view count? Not "1K views". Not "trending". The actual number. And it updates itself.
This YouTube video has exactly 1,234 views
Every 10 minutes. Automatically. The title on YouTube itself changes. Not a webpage trick. Not a hack. Just the YouTube API doing its thing.
How? YouTube has an API that lets you update video metadata — including titles. We just automate it with a cron job on Wasmer Edge (free hosting). That's literally it.
Step 1: Set Up Google Cloud (The API Key)
You need access to YouTube's Data API v3. It's free. Here's the speedrun:
- Go to console.cloud.google.com
- Create a new project (name it whatever)
- Go to APIs & Services → Library → Search "YouTube Data API v3" → Enable it
- Go to Credentials → Create Credentials → OAuth client ID
- Set Application type to Desktop app
- Download the JSON → rename it to
client_secret.json
⚠️ Important: On the OAuth consent screen, add your Google account as a "test user" or the API won't let you sign in. This catches everyone.
Step 2: Get Your Refresh Token
This is the magic sauce that lets the script run headlessly on Wasmer without a browser popup.
# Install dependencies
pip install google-auth-oauthlib google-api-python-client
# Run the setup script
python setup_oauth.py
This opens a browser → you sign in → authorize → and it prints your refresh token. Copy it. Save it. You'll need it.
💡 Pro tip: The refresh token doesn't expire (unless you revoke it). One-time setup, forever use.
Step 3: The Code
Here's what the main script does in ~30 lines of actual logic:
# Read the current view count
resp = youtube.videos().list(
part="statistics",
id=VIDEO_ID
).execute()
view_count = resp["items"][0]["statistics"]["viewCount"]
# Build the new title
title = f"This YouTube video has exactly {int(view_count):,} views"
# Update it (only if changed — saves API quota)
youtube.videos().update(
part="snippet",
body={
"id": VIDEO_ID,
"snippet": { "title": title, ... }
}
).execute()
The full script handles OAuth, error handling, exponential backoff, and skips the write if the title hasn't changed.
Step 4: Deploy to Wasmer Edge
Wasmer Edge is free hosting with native cron job support. Perfect for this.
Project structure:
Live-yt/
├── youtube_live_title_updater.py ← Main script
├── setup_oauth.py ← Run once locally
├── requirements.txt ← Dependencies
├── wasmer_app.yaml ← Wasmer config
└── client_secret.json ← Your OAuth creds
# Install Wasmer CLI (one-time)
curl https://get.wasmer.io -sSfL | sh
# Login
wasmer login
# Deploy
wasmer deploy
Then set these environment variables in the Wasmer dashboard:
| Variable | Value |
|---|---|
VIDEO_ID | Your YouTube video ID |
REFRESH_TOKEN | From step 2 |
CLIENT_SECRET_JSON | Contents of client_secret.json |
✅ That's it. The cron job in wasmer_app.yaml runs the script every 10 minutes. The title updates. Automatically. Forever.
Step 5: The Math (Why This Works for Free)
| Resource | Usage | Verdict |
|---|---|---|
| YouTube API Quota | ~7,344 / 10,000 units/day | ✅ Within limits |
| Wasmer Free Tier | 100k requests/mo | ✅ Way more than enough |
| Total Cost | $0/month | ✅ Free |
Each title update costs 51 API units (1 to read + 50 to write). At 10-minute intervals, that's ~144 cycles/day = 7,344 units. You have 10,000. We're good.
Step 6: The Meta Loop 🤯
Here's the fun part:
- Upload this tutorial as a YouTube video (set it to private first)
- Copy the video ID from the URL
- Set
VIDEO_IDin Wasmer with that ID - Wait for the first title update (up to 10 minutes)
- Set the video to public
- Watch the title update itself in real-time
🤯 Yes, it's meta. You're watching a video about making a video that updates its own title. The title of this very video shows its view count. Your brain should hurt a little right now.
What You'll End Up With
This YouTube video has exactly 1,234 views
...but the number keeps climbing. 📈
Full Source Code
The complete project is open source. Here's everything in one repo:
github.com/startupmenace/Live-yt
Clone it, follow the steps, and you'll have your own self-updating title in about 20 minutes.
Final Thoughts
This project is equal parts useful and absurd. On one hand, you get a real-time view counter on your video title — genuinely cool for demos and bragging rights. On the other hand, you're watching a video whose title is a lie that becomes truth.
The whole thing costs $0, takes 20 minutes to set up, and runs forever on Wasmer Edge. If you build one, tag us — we'd love to see what titles you come up with.
Now go make something weird. 🚀