0

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.

Test
  • 51
  • 1
  • 8
  • Not clear... **(1)** Are you asking about getting a specific channel's videos? **(2)** What does _"I am planning to pull data every day once"_ mean **exactly**, what data you need to access daily? ... **(3)** You might be able to get the same info via querying the XML feed of the Youtube channel... Basically just tell us _"From this Youtube channel called ABC (show us the link), I want to get info like X, Y and Z (then explain what your required X. Y, Z is)"_ then we can advise if it's possible outside of API without worrying about quota limits. – VC.One Jul 21 '21 at 08:17
  • @VC.One - There are hyperlinks that will show that #1 is pulling playlist, and #2 will pull all videos metadata from individual playlists. I want to ask whether if I loop all playlists, will it give me all the videos under channel id or not. – Test Jul 21 '21 at 21:55

1 Answers1

0

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.

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33