13

Is there any way to extract the "Most Replayed" (aka Video Activity Graph) Data from a YouTube video via API?

What I'm referring to:

Image of Youtube Video with "Most Replayed" Data displayed

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
prodohsamuel
  • 217
  • 3
  • 10
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 14 '22 at 02:01
  • @Community I'm not sure how many more details I can give :/ – prodohsamuel Jun 14 '22 at 13:52

1 Answers1

16

One more time YouTube Data API v3 doesn't provide a basic feature.

I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/videos?part=mostReplayed&id=VIDEO_ID, you will get the most replayed graph values you are looking for in item["mostReplayed"]["heatMarkers"]["heatMarkerRenderer"]["heatMarkerIntensityScoreNormalized"].

With the video id XiCrniLQGYc you would get:

{
    "kind": "youtube#videoListResponse",
    "etag": "NotImplemented",
    "items": [
        {
            "kind": "youtube#video",
            "etag": "NotImplemented",
            "id": "XiCrniLQGYc",
            "mostReplayed": {
                "maxHeightDp": 40,
                "minHeightDp": 4,
                "showHideAnimationDurationMillis": 200,
                "heatMarkers": [
                    {
                        "heatMarkerRenderer": {
                            "timeRangeStartMillis": 0,
                            "markerDurationMillis": 2580,
                            "heatMarkerIntensityScoreNormalized": 1
                        }
                    },
                    ...
                ],
                "heatMarkersDecorations": [
                    {
                        "timedMarkerDecorationRenderer": {
                            "visibleTimeRangeStartMillis": 0,
                            "visibleTimeRangeEndMillis": 7740,
                            "decorationTimeMillis": 2580,
                            "label": {
                                "runs": [
                                    {
                                        "text": "Most replayed"
                                    }
                                ]
                            },
                            "icon": "AUTO_AWESOME",
                            "trackingParams": "CC0Q38YIGGQiEwiFxcqD7-P9AhX8V08EHcIFCg8="
                        }
                    }
                ]
            }
        }
    ]
}
Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
  • This looks like it works, but how should I read the page it spits out? For example: https://yt.lemnoslife.com/videos?part=mostReplayed&id=NIJ5RiMAmNs. How should I read that? – prodohsamuel Jun 15 '22 at 03:53
  • 1
    @prodohsamuel Look at the "heatMarkerIntensityScoreNormalized" number. 0 is nobody is re-playing and 1 is everybody is replaying. – THEMOUNTAINSANDTHESKIES Jun 15 '22 at 04:39
  • @prodohsamuel As `heatMarkerIntensityScoreNormalized` name suggests, I recommend you to learn more about [Normalisation](https://en.m.wikipedia.org/wiki/Normalization_(statistics)). – Benjamin Loison Jun 15 '22 at 07:38