Google YouTube API allows maximum 10,000 units of quota per day. I am trying to avoid 'Quota Exceeded' error as I am making too many calls against the "Search: list" API which costs 100 units of quota per API call.
I read this and several other blogs; and went with my own below analysis.
I am planning to pull data every day once and store it in the database. Can any expert please confirm if below will cover up all the videos under the channel, or I will miss some?
(1) Playlists: list --> Get all the playlists from the channel.
(2) PlaylistItems: list --> Iterate over each playlist one by one, and get all videos in it.
To answer your comment #Test:
I want to ask whether if i loop all playlists, will it give ma all the videos under channel id or not.
If by all playlists you mean all playlists intentionally created by the given YouTube channel then it depends whether or not he selected all his videos.
I would recommend you to use this approach to retrieve all YouTube videos of a given YouTube channel which seems to be your case. The approach consists in getting the uploads auto-created playlist id of the YouTube channel by using Channels: list with contentDetails in part and then use PlaylistItems: list to retrieve all public videos uploaded on this YouTube channel. Using this method you will retrieve all public YouTube videos as long as the studied YouTube channel has less than 20 000 YouTube public videos. In this last case use this script which softwarly fake an automatic browse in the Videos tab of the given YouTube channel.
Related
I want to get search keywords from traffic source of video using Youtube Data Api.
I can already view 8-10 on the Dashboard, but most of the time, the video is in 1000 views and although I see 7-8, the api returns empty or only takes one. how can i solve this problem? I will be glad if you help.
I try finding a way to get the viewcount of the last 6 months of any given YouTube channel. The YouTube analytics API is not helpful, cause it only allows for channels I own - the YouTube data API only returns the total view count of the channel lifetime.
Is there a way I can get the view count a channel has made on a monthly basis via the API? Scraping socialblade is my second option, but I'd rather use the Google Api.
Thanks for your help!
Your going to have to do it like socalblade probably does.
Just scan each channel you want to check every month.
YouTube analytics api only stores data for three months I think and you have to be authorized as you mentioned.
The YouTube data api doesn't store data by date its not intended for analytics.
I set up a system for a client a while back that just poles a few channels every day to get stats for them. Its not optimal but it works.
I tried Analytics and Reporting APIs separately. And there are questions and answers which deals with them separately. But I want to know is there any single one shot API which gives both? The total number of videos means all the videos irrespective of the playlists. I'm doing this with ReactJS for my own portfolio website.
I did some more research on this. I couldn't find a full fledged api with documentation but you can use this:
https://www.googleapis.com/youtube/v3/channels?part=statistics&id=your-channel-id&key=your-api-key
Make sure you've that api enabled. I'm using Youtube Analytics.
as in one answer here:
Youtube Data API v3 PlaylistItems update not working for Watch Later playlists
There was a change that I can't use playlistitems.list from YT API v3 to retrive Watch Later and Watch History playlists from my channel:
https://developers.google.com/youtube/v3/revision_history#september-15-2016
TLDR:
"Requests to retrieve playlist details (playlists.list) for a channel's watch history or watch later playlist will return an empty list after September 12, 2016. Requests to retrieve playlist items (playlistItems.list) in either of those playlists will also return an empty list after that time. This is true for the new values, HL and WL, as well as for any watch history or watch later playlist IDs that your API Client may have already stored."
Is there any other way to programmatically get my Watch Later playlist other than manual scraping?
(By manual scraping I mean traversing http to login, getting into my playlist and manually parsing DOM to get links and snippets of videos in the list.)
Thanks
(Copied from here: https://stackoverflow.com/a/47117301/147507)
If I was in your position, I'd just work my requirement around it, avoiding this. You can go back to v2 or do some other stuff like scraping the website, but if the YouTube API is explicitly preventing these to be available to third parties, it might seem you could get into legal trouble.
Note that the v2 API provided separate feeds for a channel's favorite
videos, watch history, and watch later playlist. The v3 API uses
playlists and playlist items to represent all of these concepts.
From: https://developers.google.com/youtube/v3/guides/implementation/playlists
You also use the channels.list method to get the playlist IDs for a
channel's watch history playlist, watch later playlist, uploaded
videos and liked videos. Liked videos are videos that the channel
owner rated positively
How can I efficiently retrieve a list of channels that a Vimeo video is listed in from the Advanced Vimeo API?
The Advanced Vimeo API provides the methods channels.addVideo and channels.removeVideo for managing the channels a video belongs to. Also, the channels.getVideos method is provided for retrieving the list of videos belonging to a channel.
However, there is no videos.getChannels method. This means that in order to find all the channels a video is included in one would need to call channels.getVideos (possibly more than once if the channel has more than 50 videos) for each channel of interest. This seems terribly inefficient.
From what I have seen so far it has not been implemented into v1, but will be added into v2. I am still looking to see if there is an alternative
edit*
take a look at this page because they have this method vimeo.channels.getAll
VIMEO
I know this will get you a list of channels, from there I dont know if you can compare that to the video to make a list of channels that the video is in. I'm still looking.