Hi
In a youtube video i have below search items . I want to get displayed them in a column separated by comma.
#afgvpng
georgina rodriguez
Below is my code
List listVideo = new List();
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("maxResults", 100);
request.AddParameter("sortOrder", "desc");
request.AddParameter("key", "AIzaSyCFG8");
var response = client.Execute(request);
htmlTable.Append("");
htmlTable.Append("SN Channel Id / Title Video Title Description Category View Count Published ");
htmlTable.Append("");
Int32 ViewCount = 0;
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", "AIzaSG8");
tagRequest0.AddParameter("part", "snippet,statistics");
tagRequest0.AddParameter("id", data.id.videoId);
var tagResponse0 = clientTag0.Execute(tagRequest0);
foreach (var searchResult in tagResponse0.Data.items)
{
listVideo.Add(searchResult);
}
}
if (listVideo.Any())
Thanks
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ramco RamcoPosted Jun 15, 2024, 2:04 PM
Hi Udhay
These 2 provided are for sample i want all Search Items of my video to be displayed in 1 text box
Thanks
Uday DodiyaPosted Jun 15, 2024, 11:19 AM
To modify your existing code to display the search items separated by commas in a column, you can add the code that concatenates these items into a single string and then inserts this string into your HTML table. Below is the updated version of your code:
Key modifications:
qparameter of the initial request to the YouTube Data API.Search Terms in the HTML table.#afgvpng, georgina rodriguezas a static string in each row of the table.