July 1, 2015 by Nitesh

List Videos From a Channel using YouTube API V3 in C#


Google has retired YouTube API V2 and trying to fetch videos using the API V2 returns an error as “410 Gone Away“. In this post, we will see how can we retrieve all videos from a specific YouTube Channel using the latest YouTube API V3.

Let’s get started 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. In case you’re unaware of installing Nuget packages to your application, check it out here.



  • Once the project gets created, “Select the project” and go to “APIs & Auth” > “Credentials” from the left sidebar.


  • If you just want to retrieve videos, you can go ahead and click on “Create new Key” under Public API access. However, if you want to use oAuth to validate user credentials before showing them videos, you need to create Client ID. For this example, we will be using “Public API access”.
  • After the key is created, copy the key in a notepad file.
  • Coming back to the application, below is the complete code —
using System;
using Google.Apis.YouTube.v3;
using Google.Apis.Services;

namespace YoutubeVideos
    class Program
        static void Main(string[] args)
            YouTubeService yt = new YouTubeService(new BaseClientService.Initializer() { ApiKey = "YOUR_API_KEY" });

            var searchListRequest = yt.Search.List("snippet");
            searchListRequest.ChannelId = "YOUR_CHANNEL_ID";
            var searchListResult = searchListRequest.Execute();
            foreach (var item in searchListResult.Items)
                Console.WriteLine("ID:" + item.Id.VideoId);
                Console.WriteLine("snippet:" + item.Snippet.Title);

The above code will list the VideoID and Title of the videos present in your channel.

I hope this article helped you in retrieving YouTube videos from your channel. Let me know in case you have any other way of doing so or need any help.

  • Jayant Tripathy

    I am using this code but i have one issue, in my channel there is 7 video but it fetch 4 only . can you please guide me.

    • Use this line to increase the number of videos brought to 50 –
      searchListRequest.MaxResults = 50

      • Jayant Tripathy

        Thanks that’s work perfectly. All the video fetch smoothly in local machine but when i upload the code to server then it can’t fetch nothing and it hangs the server. Time out issue happens, I am using godaddy server.

        • Please check with fiddler. Something fishy with godaddy servers 🙂

Support us!

If you like this site please help and make click on any of these buttons!

Powered by WordPress Popup