Ramco Ramco

Ramco Ramco

  • 440
  • 3.4k
  • 529.4k

Search Keywords of Own Video

Apr 11 2024 7:22 AM

Hi

  I have below code & i want to get Traffice Source keywords to my own Video

List<VideoListResponse.Item> listVideo = new List<VideoListResponse.Item>();
            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("key", "A8");
            var response = client.Execute<YoutubeSearchListResponse>(request);

            foreach (var data in response.Data.items)
            {
                var clientTag0 = new RestClient("googleapis.com/youtube/v3/");
                var tagRequest0 = new RestRequest("videos", Method.GET);
                tagRequest0.AddParameter("key", "A8");
                tagRequest0.AddParameter("part", "snippet,statistics");
                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 (2)