Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a list of uploaded videos for a certain channel with the new YouTube Data API (V3)?

Tags:

youtube-api

I am trying to get a list of video ids for all uploaded videos to a channel. I would also like to use the new version of the YouTube Data API (V3). How do I do this?

like image 696
codingjeremy Avatar asked Nov 22 '12 02:11

codingjeremy


People also ask

How to get a video list by Channel name of YouTube?

We need a video list by channel name of YouTube (using the API). We can get a channel list (only channel name) by using the below API: Now, we need videos of channel >> UCqAEtEr0A0Eo2IVcuWBfB9g or HC-8jgBP-4rlI.

How to enable YouTube Data API?

Enable YouTube Data API. Click on the Credentials. Select API key under Create credentials. Copy the API key. We will need it in a moment. Once you are ready with the API key, create 3 files in your project.

How to retrieve all videos from a specific YouTube channel?

In this article, we will see how to retrieve all videos from a specific YouTube Channel using the latest YouTube API V3. Let's get started by creating the application. We create a new stand alone application named “YouTubeVideos” and install the Nuget package named “Google.Apis.YouTube.V3″ to the application.

How to download a list of YouTube channels in Python?

To Download the List one can use Youtube API, too. There is no need to use additional tools like youtube-dl That's my Python solution, using Google API. Observations: Create a .env file to store your API Developer Key, and put it in your .gitignore file The parameter "forUserName" should be set with the name of the Youtube Channel (username).


Video Answer


1 Answers

You have to get the upload playlist id to get each videos uploaded. To get that, you need to get the channel id. After you have the playlist id from the channel id, it is pretty simple. I have written out the steps for all three below.

Also, we offer PubSubHubBub which allows you to be alerted every time a new video is added to a channel, or you could use SUP (V2) to see which resources have changed before making the calls.

Instructions to get video ids for all uploaded videos for a channel in V3

  1. Get the channel id for the channel you want (you probably only need to do this once, then you can save it)

    • Use search.list
    • Set type to channel
    • Set q to the name of the channel you want
    • Grab the channel id (something like this: "channelId": "UC0X2VuXXXXXXXXXXXXXXXX")
  2. Get the playlist id for the channel uploads using the channel id from step 1 (you probably only need to do this once, then you can save it)

    • Use channels.list
    • Set id to UC0X2VuXXXXXXXXXXXXXXXX from step 1
    • Grab the uploads key from contentDetails (something like this: "uploads": "UU0XXXXXXXXXXXXXXXXXXXX")
  3. Get the videos via the playlistitems in the playlist using the playlist id from step 2

    • Use playlistItems.list
    • Set playlistId to UU0XXXXXXXXXXXXXXXXXXXX from step 2
    • Go through each PlaylistItem and pull out the video id
like image 112
codingjeremy Avatar answered Oct 10 '22 07:10

codingjeremy