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?
>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.