Created
February 20, 2019 04:23
-
-
Save jasongaylord/7e4b20296b87a760b57d24d11a152d4e to your computer and use it in GitHub Desktop.
YouTube API Connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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