Ramco Ramco

Ramco Ramco

  • 426
  • 3.5k
  • 575.7k

List my own Youtube Videos

Feb 9 2025 2:12 PM

Hi

  I have below code to list my own videos but it is saying No Data Found. In allitems it is showing Count = 0

        protected void MyOwnVideos()
        {
            StringBuilder htmlTable = new StringBuilder();

            var client = new RestClient("googleapis.com/youtube/v3");
            var request = new RestRequest("search", Method.GET);
            request.AddParameter("part", "snippet");

            request.AddParameter("type", "video");

            request.AddParameter("channelId", "_nNoaVw");
            request.AddParameter("key", "AIzaSyFG8");

            List<YoutubeSearchItem> allItems = new List<YoutubeSearchItem>();

            IRestResponse<YoutubeSearchListResponse> response = client.Execute<YoutubeSearchListResponse>(request);


            htmlTable.Append("<table class='table table-bordered table-hover datatable-highlight' id='tbldata'>");
            htmlTable.Append("<thead><tr><th>Video Id</th><th>Video Title</th><th>Description</th><th>Views</th><th>Like</th><th>Comment</th><th>Published</th></tr></thead>");
            htmlTable.Append("<tbody>");

            foreach (var data in allItems.OrderBy(x => x.snippet.publishedAt))
            {
}

Thanks


Answers (1)