get daily view of a given video - YouTube Api V3 - youtube

I want to get the daily view of a given video.
For example, I have a YouTube video ID, Then I need to retrieve its channel id, Then I need to get the daily viewcoun of that video.
My problem is that I can only get information about my channel (Logged in user's channel). I can not see the results for other users at all. It says it is "forbidden"
Ps. I used both google.api.explorer and a python code. (the authentication is OK.)
Does anyone know how to get these info?

If you run your program twice such that 00:00 Monday and 00:00 Tuesday, you can get daily viewCount of the video since you are able to get statistics of a single video. However, if you want to find dailyViewCount of a video, I think you would not able to do it. You can follow my way in unix by crontab in order to run in every 24 hours and get result and use it later to subtriction

Due to privacy issues, you can only access to your own videos (or the videos uploaded by channels you manage) statistics.
For other videos, you can get basic numbers like viewcounts etc but not in detail.

Related

How to retrieve video including paid promotion by YouTube API

We want to retrieve video data including promotions.
Is there a way to get it with the YouTube Data API or the YouTube Analytics API?
Is there any other way?
A video that includes a promotion is a video that displays something like the image below.
Click to move to the following page.
https://support.google.com/youtube/answer/154235
Since you are only interested in knowing whether or not a video (based on its id) includes paid promotion, as far as I know there isn't any official YouTube Data API v3 endpoint answering your question.
However you can check if the video includes paid promotion by checking whether or not the YouTube webpage contains paidContentOverlayRenderer. You can proceed this way for instance:
curl -s https://www.youtube.com/watch?v=VIDEO_ID | grep "paidContentOverlayRenderer"
If something is returned it means that the video includes paid promotion otherwise it doesn't.

Can I get a YouTube user's session data from the YouTube API?

I am a teacher and I have a YouTube channel with videos for my students. Every time one of my students see a video, I would love to know how he interacted with it: where he has paused it , where he has rewinded it, etc. This would help me in knowing the parts of the video that are difficult to understand.
My question is: is it possible to get all this data from a user's session? Specifically, can I get these detailed raw data from YouTube APIs?
From what I have explored so far, it seems that it is not possible, as YouTube APIs only seem to send "aggregated" data (example: total number of views of a video) or "properties" (example: title of the video).
I would really just need a Yes/No answer to my question, just to know if I am not waisting my time in exploring the APIs as a solution to my problem.
Thank you.
Yes and no,
But here is a more detailed explanation.
The YouTube Analytics api will give you analytics data on your own YouTube channel, but it wont be user specific you cant track who exactly did something. You may however be able to get some basic information about each video and what was clicked and how much was viewed. video reports But its not going to be user specific you wont know what Mike did as opposed to what Jane did.
The YouTube Data api will allow you to manage your own YouTube Channel for example upload videos and see subscriptions. It will also let you search for public videos on YouTube.
If you do want user specific then What you are looking for is session data related to user activity. Something like this is not publicly available. Google couldn't share your students activity without the students permission due to GDPR not to mention the fact that tracking anyone under the age of 13 would also be against some GDPR laws if i remember correctly.
Even Google analytics doesn't offer websites a decent way of tracking individual users activity on their websites. You can do it but you have to add additional tracking data to your website, and notify users that you are doing it.
SO your answer is yes kind of

Youtube API - Difference between number of videos from channel statistics and number of videos uploaded

I am trying youtube API to get the number of videos using the call
https://www.googleapis.com/youtube/v3/channels?part=statistics&id=[id]&key=[key]
However, there is a mismatch in the number of uploaded videos. There are 178 videos uploaded in the channel and the channel statistics API is showing 177.
Why is the difference of 1 count?
UPDATE
After 3 days, I got the correct count from channel statistics API.
Still, the question is "Is there a chance to get the difference?"
If that is the case, I would prefer to use the number of videos uploaded instead of the channel statistics.
Watch time report shows the following data collected from youtube.com, the video watch page, mobile Youtube apps (some data is only available from youtube.com).
Note: Analytics views data is based in Pacific Standard Time, updated once a day, and has a delay of up to 72 hours. The numbers you
see in Analytics reports might be different from the numbers you see
on the video page, channel page, Video Manager, or other sources.
Then I suggest that you use the number of videos uploaded.

How to get average watch time for a youtube video?

According to Youtube Analytics documentation, you can only get watch time for videos uploaded to your own channel, and you can't get it for playlisted videos (except in the context of a playlist, which is useless to me). The documentation also states that if you want to access watch time information, you need a permission from the owner of the channel.
https://developers.google.com/youtube/reporting/#Report_Contents
Is it possible to get Average Watch Time for any youtube video using Youtube data API or Analytics API, or using any other source and how?
You may check averageViewDuration which is the average length, in seconds, of video playbacks. In a playlist report, the metric indicates the average length, in seconds, of video playbacks that occurred in the context of a playlist.
Example:
Total view counts, estimated watch time, and more for a channel
This query retrieves aggregated metrics for the channel's content. The report returns a single row of data that contains totals for each requested metric during the specified date range.
metrics=views,comments,likes,dislikes,estimatedMinutesWatched,averageViewDuration
Hope this helps!

Expected delay for youtube feeds?

We switched over to YouTube from a previously developed internal video system, and right now I've got it going on public upload feeds for users. The problem comes when we first got only about a dozen out of 150 or so videos available from the primary user's account. Over time of the day that number rose to about 50, and its stayed there. I found one post on the YouTube API forums about delay, but no word on how long I can expect that.
Anyone have experience about this to tell me what to expect?
Expected latencies can vary, and are documented here (http://code.google.com/apis/youtube/2.0/reference.html) - ways you can minimize it:
1) Upload the video as public. If you upload the video as private first, this will leave the video out of the fast-track indexing
2) Make an authenticated request to the user feed, this will guarantee the freshest data that the API has.
ie. http://gdata.youtube.com/api/feeds/users/username/uploads (with a dev key and auth token for 'username') instead of http://gdata.youtube.com/api/feeds/videos?author=username

Resources