How to get average watch time for a youtube video? - youtube

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!

Related

Getting monthly view counts of any YouTube video's

I'm using the Youtube Data API to access the total viewCount of a video.
However, I would like to see the monthly views of a video based on a specific date and/or time. For example, video A currently has a viewCount of 500,000 at the current date and time but perhaps a month ago it had a viewCount of 400,000. Is it possible to access that previous value?
Is there any Youtube API method or alternative resource that would allow me to access the previous view count of a video/list of videos for any public channel?
Thank you!

How to get metrics from YouTube Analytics API for every video which belongs to current user?

I want to get metrics (such as likes, views and subscribers gained) for every video in my youtube channel (or about 10 latest video) , how can I do it correctly?
I'm using such API call from Youtube Analytics API, but it turns out that it returns total views and total likes from all videos, not individually about every video.
`https://youtubeanalytics.googleapis.com/v2/reports?metrics=views,likes,subscribersGained&ids=channel==MINE&startDate=2014-07-03&endDate=2020-06-01&&key=${apiKey}&access_token=${token}`
I read documentation of YouTube Analytics API and I can't find this information there.
If you want the response to be grouped by video your have to specify the dimension parameter to video.
Here is a sample request from the documentation (Basic stats/Top 10 – Most watched videos for a channel):
https://developers.google.com/youtube/analytics/sample-requests#Channel_Reports
Although the note does not specify it, the sort parameter must be the first metric that you declared.
If want to get information on more that 10 videos or to pull information for the latest videos, you can specify the dimension as video and you must specify the video ids in the filter parameter as video==VIDEO1_id,VIDEO2_id....
The videos in a channel can be retrieved through the YouTube Data API from the search endpoint.
You will get a list of videos with their details as a response, among others the videoId and publishedAt values.

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.

get daily view of a given video - YouTube Api V3

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.

Latency with Youtube Analytics API

This page (http://apiblog.youtube.com/2012/03/keeping-things-fresh.html) does a great job of explaining the latency of results obtained using the Youtube API version 2.0. Is there an equivalent explanation for the Youtube Analytics API?
I viewed and liked a video today that previously had no action and then retrieved statistics using the Analytics API (with both start-date and end-date equal to today) and my actions were not reflected - all metrics were still zero. Do I need to wait until tomorrow for today's totals to be calculated? If yes, is there any way to get the current day's analytics?
The YouTube Analytics API uses the same backend as the YouTube Analytics website, and the public information about data freshness that applies to the website also applies to the API. There's some relevant info at
http://support.google.com/youtube/bin/static.py?hl=en&guide=1714169&page=guide.cs
Specifically, the bottom of the page reads (as of right now):
YouTube Analytics data is updated daily, which means that the numbers displayed in these reports may differ from the public values displayed on the Watch page, Channel page, Video Manager, or other sources.
I don't think we specifically guarantee what time of day the data updates, but it's safe to assume that the previous day's data is processed sometime after midnight Pacific Time (which is the time zone used for YouTube Analytics).

Resources