Episode-over-episode race, normalised by age
yt_episode_raceCompare episodes fairly by re-indexing daily metrics to days since publish, so equal-age episodes can be judged head-to-head. Returns cumulative curves and a leaderboard.
Instructions
The derived view: compare several videos on equal terms by re-indexing each one's daily numbers to days since its own publish date, so day 7 of a new episode sits next to day 7 of the last five. Raw totals cannot answer 'is this episode outperforming?' because an older video has simply had more days to accumulate; this removes that. Returns each video's cumulative curve by age plus a leaderboard at the oldest day all of them have reached, with each video's raw per-day API values returned alongside the running totals. Costs 1 YouTube Data API quota unit for publish dates (required — the normalisation is impossible without them) plus one Analytics query per video.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metric | No | Which metric to race on. | views |
| video_ids | Yes | Two to ten video IDs to compare. Get them from yt_top_videos, or use your last N episode IDs. | |
| as_of_date | No | Treat this date as 'today', YYYY-MM-DD. Defaults to yesterday (UTC), since YouTube Analytics lags. Pass it explicitly for a reproducible comparison. | |
| window_days | No | How many days after publish to track, 1-90. Each video's curve is truncated at its actual age — a 3-day-old video returns 4 points, not 28 padded ones. |