# Getting viewers of a video over time

**URL:** <https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971>\
**Category:** API\
**Created:** [March 29, 2018, 2:47pm UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971 "2018-03-29T14:47:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zimola](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/zimola/32/4338_2.png) [@zimola](https://discuss.dev.twitch.com/u/zimola)\
**Post date:** [March 29, 2018, 2:47pm UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971/1 "2018-03-29T14:47:05Z")

</div>

I was trying to get the current viewers watching the video over the duration of the video. I was hoping someone had a technique that I could use to accomplish this.

For example: Getting live viewers of video\_id 242561765 at video\_index 0:00:00, 0:00:10, and so on…

---

<div class="post-metadata">

**Author:** ![george](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/george/32/120_2.png) [@george](https://discuss.dev.twitch.com/u/george)\
**Post date:** [March 29, 2018, 9:05pm UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971/2 "2018-03-29T21:05:01Z")

</div>

The API does not provide that historical information. You would need to keep track of the value yourself while the content is live.

---

<div class="post-metadata">

**Author:** ![xDemonsxXxSaintx](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/xdemonsxxxsaintx/32/4144_2.png) [@xDemonsxXxSaintx](https://discuss.dev.twitch.com/u/xDemonsxXxSaintx)\
**Post date:** [March 30, 2018, 12:12am UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971/3 "2018-03-30T00:12:56Z")

</div>

Actually it is possible to acquire this imformation on VODs but requires you to make your own browser extension. I prefer using “tampermonkey” which is a browser extension that allows users to write their own scripts with ease via javascript. This extension is available for most modern browsers.

If you have the extension running while the video & chat is being played back, then you can write a script using the browsers “mutation observer api” to watch for any changes made to the chat being played back and extract the username and message.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 30, 2018, 11:50am UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971/4 "2018-03-30T11:50:35Z")

</div>

> [@xDemonsxXxSaintx](#):
>
> he browsers “mutation observer api” to watch for any changes made to the chat being played back and extract the username and message.

Which only gives you a count of people chatting at that second. Not the number of viewers

---

<div class="post-metadata">

**Author:** ![xDemonsxXxSaintx](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/xdemonsxxxsaintx/32/4144_2.png) [@xDemonsxXxSaintx](https://discuss.dev.twitch.com/u/xDemonsxXxSaintx)\
**Post date:** [March 30, 2018, 12:43pm UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971/5 "2018-03-30T12:43:02Z")

</div>

Correct, the method I have specified won’t obtain an accurate count of viewers if that was the intent. However, if the intent was to obtain the list of chatters and their messages on a VOD this would be the method to do so. The question was unclear if zimola wished to acquire the total views at any given point on the VOD or just the users and their messages. I went with the latter, hoping I answered the question accurately.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [April 29, 2018, 12:43pm UTC](https://discuss.dev.twitch.com/t/getting-viewers-of-a-video-over-time/14971/6 "2018-04-29T12:43:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
