Hi
I have given below code for most popular. If i want to give most viewd , what changes i need to do
var searchRequest = yt.Videos.List("snippet");
searchRequest.Chart = VideosResource.ListRequest.ChartEnum.MostPopular;
Thanks
Hi
I have given below code for most popular. If i want to give most viewd , what changes i need to do
var searchRequest = yt.Videos.List("snippet");
searchRequest.Chart = VideosResource.ListRequest.ChartEnum.MostPopular;
Thanks
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 Dec 19, 2022, 12:54 PM
Hi
I am trying like below but it is giving error . Oder does not exist in the current context.
using (var yt = new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = "ApiKey",
}))
{
StringBuilder htmlTable = new StringBuilder();
var request = yt.Videos.List("snippet");
request.order = SearchResource.ListRequest.OrderEnum.ViewCount;
Thanks
Deepak TewatiaPosted Dec 19, 2022, 5:29 AM
Hi Ramco,
Good morning !
This error message suggests that the ChartEnum enumeration does not include a value for MostViewed.
To get the most viewed videos, please try the below code to retrieve the videos based on view count.
This will retrieve the videos in descending order of view count, with the videos with the highest view count appearing first.
Thanks
Ramco RamcoPosted Dec 19, 2022, 5:19 AM
Hi Deepak
It is giving message - VideosResource.ListRequest.ChartEnum does not containa definition for MostViewed.
Thanks
Deepak TewatiaPosted Dec 17, 2022, 7:47 PM
Hi Ramco,
This will retrieve a list of the most viewed videos on YouTube.