I put my YouTube channel's live numbers on my own site
My YouTube channel is League of Legends: full games and short clips from my Kalista ADC games in Emerald. I already post to it with a Discord bot. The YouTube page on this site shows the channel’s numbers, refreshed every three hours, and the latest uploads.
I had three reasons for building it. I wanted to build something that works with the Discord bot I already use for posting: the bot puts the videos up, and this page shows how they do. I wanted the channel to be easier to discover. And I wanted somewhere on my own website to track how the channel performs, so the numbers show how my tool is doing.
Why a page can’t just ask YouTube
YouTube’s numbers come from the YouTube Data API, and every request needs an API key. A web page that asked YouTube directly would have to put that key in its source, where anyone could copy it and spend its quota. So the asking happens somewhere else: a small Cloudflare Worker, the same one behind this site’s reefer rate board and border wait board.
How it works
- Every three hours, the Worker wakes itself up. A cron trigger runs it at 17 past midnight, 3, 6 and so on (UTC). Nobody has to visit the page, and my computer doesn’t have to be on.
- It asks YouTube three questions. One call gets the channel’s subscribers, total views and video count, one gets the list of its latest uploads, and one gets each upload’s views, likes and length. Each call costs one unit of YouTube’s free daily quota of 10,000, so the whole day costs 24.
- It writes the answer down. The latest snapshot goes into a small SQLite database on Cloudflare (D1), along with one row per day for the last 40 days, which is where the day-by-day changes come from. If YouTube doesn’t answer, nothing is overwritten.
- The page reads the snapshot, not YouTube. A visit costs YouTube’s quota nothing, and Cloudflare keeps a copy at the edge for five minutes, so most visits don’t even reach the database.
- At least once a day, a copy goes into the page itself. A GitHub Action writes the snapshot into the page’s HTML. That’s what search engines and link previews see. The same run adds each day’s numbers to a CSV in this site’s repository, which is the permanent record; the database only keeps the recent days the page needs.
The key is a plain API key stored as a Cloudflare secret. It can only read public data, so it can’t upload or change anything on the channel. The bot does the uploading with its own sign-in and its own quota, so this page can never get in its way. All of it runs on free plans.
For discoverability, the page is built to be found and to send people on. Its title and description say what the channel is, the numbers and the latest full game and Shorts are in the HTML, every recent upload links to YouTube, and a “Browse by matchup” row turns titles like “Kalista vs Smolder” into searches of the channel.
What the numbers show
When the site last copied the snapshot, on October 16, 2026, the channel had 183 videos, 92,443 views all time and 14 subscribers. The 12 latest uploads, from October 13 to 16, split very unevenly:
| Upload | Count | Length | Views by October 16 |
|---|---|---|---|
| Shorts | 8 | 35–43 seconds | 5,838 |
| Full games | 4 | 23–34 minutes | 1 |
The most-viewed was a Short, “What should Thresh & Jhin have done vs Kalista?”, at 1,339 views. The day-by-day log shows the channel gained 2,310 views on October 15 and 2,213 on October 16 by the time of the copy, with no change in subscribers either day.
Where it breaks
- It’s a few days of data. The full games were all uploaded in those same four days, the last one hours before the copy, so their counts may still move. Four days can’t say how a full game does over a month.
- The day-by-day history is short. It holds one row per day, so it only says something once there are weeks of rows.
- Some of it is YouTube’s rules, not mine. The public subscriber count is rounded to three significant figures, and “Short” on the page means an upload three minutes long or less, which is YouTube’s own limit for one.
Updated October 18, 2026: the Worker now polls every three hours instead of every hour, since a channel this size barely moves in an hour, and every day’s numbers are kept in the site’s repository rather than in the Worker’s database. The numbers above are from the October 16 copy.
The YouTube page has the live numbers, the latest full game and Shorts, every recent upload and the day-by-day changes. The Worker’s code is in the worker folder of this site’s repository.