Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Youtube view history for arbitrary videos

I would like to track the number of views of a video (not necessarily mine) over time. It’s not clear that this is possible through the YouTube Api and Social Blade tends to focus on users, not videos.

I know I can create my own history by using the YouTube Api every day but it would be preferable to download this data directly.

Any thoughts?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There is no YouTube api that will give you this information over time.

There is a public endpoint Videos: list Which will allow you to make a call to the YouTube data api and request information for a specific video.

curl \
  'https://youtube.googleapis.com/youtube/v3/videos?part=statistics&id=m3euwXcuvrs&key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --compressed

The response will then give you back some info on that video

"statistics": {
        "viewCount": "2894",
        "likeCount": "52",
        "favoriteCount": "0",
        "commentCount": "10"

Combined with the search.list method which will return to you a list of all videos for a channel.

You would be able to poll the api for stats on a video every day.

This is most likely how Socalblade is doing it. VideIq and Tubbuddy both require that the user grant their application access to YouTube analytics which would give them more information and over a greater point in time.

SocialBlade just needs someone to search on a channel once and then they probably add it to their daily poll of the YouTube Api. This is of course just my experience / guess as i remember it took a few days for SocialBlade to start showing stats on my YouTube channel.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading