Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 527.8k

How to get Search Keywords of Video

Apr 6 2024 9:06 AM

Hi

 How to get Search Keywords of Video. I am trying below code

List<VideoListResponse.Item> listVideo = new List<VideoListResponse.Item>();
            var client = new RestClient("youtube/v3");
            var request = new RestRequest("search", Method.GET);
            request.AddParameter("part", "snippet");
            request.AddParameter("type", "video");
            request.AddParameter("key", "AJHKJHSKJGIUTJSHSHSG8");
            var response = client.Execute<YoutubeSearchListResponse>(request);

            foreach (var data in response.Data.items)
            {
                var clientTag0 = new RestClient("youtube/v3/");
                var tagRequest0 = new RestRequest("videos", Method.GET);
                tagRequest0.AddParameter("key", "AIzaSyAu9f5blF7idzt6cGul59UQ9b5Ls8ECFG8");
                tagRequest0.AddParameter("part", "snippet,statistics");
                tagRequest0.AddParameter("order", "viewCount");
                tagRequest0.AddParameter("id", data.id.videoId);
                var tagResponse0 = clientTag0.Execute<VideoListResponse>(tagRequest0);

                foreach (var searchResult in tagResponse0.Data.items)
                {
                    listVideo.Add(searchResult);
                    var tags = searchResult.snippet.tags;
                }
            }

Thanks


Answers (1)