Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
YouTube API Connection
public List<Google.Apis.YouTube.v3.Data.SearchResult> LatestVideos()
{
var youTubeService = new YouTubeService(
new BaseClientService.Initializer() {
ApplicationName = "{Project}",
ApiKey = "{API_key}"
}
);
var listRequest = youTubeService.Search.List("snippet");
listRequest.ChannelId = "{Channel}";
listRequest.MaxResults = 5;
listRequest.Order = SearchResource.ListRequest.OrderEnum.Date;
listRequest.Type = "video";
var response = listRequest.Execute();
return response.Items.ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment