256
YouTube Watch History Analysis
Ever wondered how much time you spend watching videos? Let's count it.
Getting the data
The only realistic way to obtain this information is Google Takeout. For those who don't know, it's a service regulators made YouTube/Google provide. Through it you can download practically everything Google knows about you.
Search histories, visits to Google services, Android device location, calendar entries — and much more from about 70 different services. You might discover Google has more data about you than you realize.
But that's not the point. The full archive can take several days to generate and weigh terabytes; we only need a tiny part of it.
YouTube and YouTube Music (history / JSON)



Here you'll get JSON with your video watch data and, if applicable, music listens from YouTube Music.
Google doesn't keep your entire lifetime watch history; in my case this only goes back to February 2021.
My Activity (YouTube / JSON)



My Activity contains your "activity" — likes, dislikes, and also YouTube video watches. Here I have watch entries since March 2018, and likes since July 2010, likely because that's when I created my Google account.
The watch entries overlap with those from the previous source, so we'll deduplicate them by watch time and video ID. In principle you could use only My Activity, but since I can't be sure everyone will have the same coverage, the script supports both sources and automatically removes duplicates.
Parsing the data
After you generate, download, and unpack the archive, the structure will look roughly like this:
Takeout/
├── YouTube and YouTube Music/
│ └── history/
│ └── watch-history.json
└── My Activity/
└── YouTube/
└── MyActivity.json
Examples from watch-history.json:
{
"header": "YouTube",
"title": "Watched https://www.youtube.com/watch?v\u003dcK3NMZAUKGw",
"titleUrl": "https://www.youtube.com/watch?v\u003dcK3NMZAUKGw",
"time": "2021-02-04T20:54:00.428Z",
"products": ["YouTube"],
"activityControls": ["YouTube watch history"]
}
Examples from MyActivity.json:
{
"header": "YouTube",
"title": "Liked BEST DNB BEATBOX",
"titleUrl": "https://www.youtube.com/watch?v\u003dA94EEk2rZpU",
"subtitles": [{
"name": "MITYA music",
"url": "https://www.youtube.com/channel/UCir0GAhcTHfbGvDehH3RtTw"
}],
"time": "2010-10-22T14:25:15Z",
"products": ["YouTube"]
}
From here it's straightforward — I asked Cursor to write parsers and build the analytics. After a few iterations I ended up with a Python CLI script that does it all.
I put everything into a repo so anyone can analyze their own data: https://github.com/positron48/youtube-history-analyzer/tree/master.
The script ignores likes, dislikes, subscriptions, and other events, including listens from YouTube Music. We're focusing on video content. YouTube Music was my primary music source for a while — and I listen quite a lot.
Watch time
Unfortunately, Takeout does not include watch duration or even the durations of the videos you watched. We have to collect this ourselves — not literally by hand, but via the YouTube Data API v3.
To do that, first obtain an API key:
- Create a project in Google Cloud Console
- Enable YouTube Data API v3
- Create an API key
- Save the key to a file named
youtube_api_key.txtin the project root
Detailed instructions are in API_INSTRUCTIONS.md in the repository.
One of the script's menu items lets you (with an API key) fetch watch-time data for a sample of videos. You can set any amount, but the YouTube API gives you no more than 10,000 requests per day for free, so specifying more makes no sense. In practice, a sample of 1,000–1,500 videos is enough to estimate the average video length with reasonably tight confidence intervals:

In my filter bubble the average video lasts 23.9 minutes (yes, I like long videos). If you don't want to wait long, 200–300 requests also yield a fairly accurate mean, within a couple of minutes of error.
A large number of videos from the history are unavailable — about 5% for me — partly because the authors deleted or privatized them, partly because of channel bans. They don't affect the stats much.
The report
Besides the main figures, the report also plots views over the whole period, by weekday, by time of day, the top 10 channels, and a rough estimate of total watch time.
Here's my report:






It's a pity Takeout doesn't include your entire history. Since March 2018 I've spent about 18k hours on YouTube. Some of that was in the background, a significant portion is music, and some videos weren't watched to the end. As a top-end estimate, that's about 6.5 hours per day!
Interpreting the results
It's interesting to look at the dynamics — what caused the spike in 2020–2021 and the dip in 2024?

The first part is easy to explain, and you can probably guess it — the COVID-19 pandemic. In spring 2020 everyone was sent to remote work and I worked from home, often with YouTube in the background. Mostly music, which I usually listen to while working anyway, so it didn't hurt productivity. That's likely why music dominates the top channels.
The dip is more personal: I started dating and my YouTube time dropped sharply.
But I haven't been watching YouTube only since 2018 — it's much longer. If we stick with the same upper-bound estimate and assume my preferences didn't change much, the most plausible start date is September 1, 2009 — the year I moved to the city and entered university. Before that I lived outside the city and decent internet wasn't available.
Thus, from 2009-09-01 to 2025-09-01 the upper-bound estimate is 38,000 hours.
On torrent trackers there's the concept of "ratio" — the amount uploaded relative to the amount downloaded. If the value is greater than 1, you've given more to the collective torrent network than you've taken. This used to be a meaningful number 15 years ago. Nowadays torrents often let you download anything without limits, sometimes requiring registration. Back then you couldn't download anything if your ratio dropped below 0.3–0.5. You had to upload at least half of what you downloaded to get something new.
Currently the total watch time of my YouTube videos is about 4,600 hours, mostly thanks to a single 11-second Short that's been watched 2+ million times. So my current coefficient is 0.12 — I've "given" YouTube 12% of what I've taken. Not bad for a start; I plan to keep going.
Once it passes 1.0, I can introduce the next coefficient — compare the hours people spend watching my videos to my entire lifetime.
And once again, if you missed it — you can run the same analysis on your own data. The script is in the repo — https://github.com/positron48/youtube-history-analyzer. The instructions for exporting data and getting an API key are also duplicated there.
No comments yet
-
Goback - easy backups
I finally decided to properly tackle backups. Once again, I had to rely on cust… -
Project Watcher
This Halloween-timed project is a one‑eyed Cthulhu statue with a mechanized eye… -
Universal AI Telegram Bot
Want to launch your own AI Telegram bot in just a couple of steps? -
Image2model with Tripo3D and Blender
Sometimes you want a drawn or AI-generated character to become real. -
Local Telegram Emulator
Have you ever written Telegram bots? -
Reviving Coat Hanger Bases
We have a couple of coat hangers with hangers at home, where clothes are conven…