DEV Community

Cover image for How I detect breakout YouTube videos with a median, a square root and a 10,000-unit quota
Pascal Clément
Pascal Clément

Posted on Edited on

How I detect breakout YouTube videos with a median, a square root and a 10,000-unit quota

By the time a video shows up in my recommendations, ten other channels have already made their version. So I built a small tool that checks the channels in a niche every morning and flags uploads that do much better than that channel normally does. Here's how it works, and what the YouTube API quota taught me.

There's a live, read-only demo of one real niche: https://watch.seedflows.ai/demo

1. A baseline per channel: the median, not the average

For each channel I take its long-form videos that are between 2 weeks and 5 months old and use the median of their views. One viral hit wrecks an average; the median ignores it. Shorts get their own baseline, because they live in a different world.

2. Adjusting for age

A 3-day-old video hasn't had time to collect its views. So the expectation grows with age:

expected = baseline * min(1, sqrt(max(age_days, 1) / 14))
Enter fullscreen mode Exit fullscreen mode

On day 1 a video "should" have about 27% of the baseline, on day 4 about 53%, from day 14 on 100%. It's a heuristic I picked by looking at data, not a fitted model. Better ideas are welcome.

3. The score

score = views / expected
Enter fullscreen mode Exit fullscreen mode

2x or more is a breakout, 1.3x is "above average". Every check stores the view count, so the next check shows views per day: a lucky first day and a video YouTube keeps recommending look very different.

4. Titles that travel

After each check, all titles in the niche are compared with each other. When near-identical titles show up on 2–3 channels within a few weeks, that's a format spreading through the niche. In my experience that's the most useful signal of all.

5. Living with the quota

The YouTube Data API gives a project 10,000 units a day, and that's the real constraint:

  • Uploads come from each channel's uploads playlist (1 unit per page) instead of search (100 units).
  • A channel that any check fetched in the last few hours is reused instead of fetched again.
  • Every user has a daily allowance shared across their niches, so one big watch list can't eat everyone's checks.
  • The limits live in a settings table the admin page can change, so tuning them doesn't need a deploy.

Stack

Next.js, Postgres with Drizzle, a small Node worker for the daily checks, Stripe for billing.

Try it

The demo shows one real niche, read-only: https://watch.seedflows.ai/demo
If you want your own niches, it's at https://watch.seedflows.ai.

I'd love feedback on the age curve in particular. How would you model expected views by age?

Top comments (0)