Hi
How to get Search Keywords of Video. I am trying below code
C#
List listVideo = new List();
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(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(tagRequest0);
foreach (var searchResult in tagResponse0.Data.items)
{
listVideo.Add(searchResult);
var tags = searchResult.snippet.tags;
}
}
Thanks

Jayraj ChhayaRank #304 · 8.2K reputationPosted Apr 8, 2024, 3:07 AM EDT
To extract search keywords from a video using the given code, you need to access the
tagsproperty within thesnippetof each video item. Thetagsproperty contains the keywords associated with the video. By iterating through theitemsin the response and accessing thesnippet.tagsproperty, you can retrieve the search keywords.Here is a snippet of how you can access the search keywords from the video data:
foreach (var searchResult in tagResponse0.Data.items) { listVideo.Add(searchResult); var tags = searchResult.snippet.tags; // 'tags' variable now contains the search keywords for the current video }