Using the first example found here https://developers.google.com/youtube/v3/code_samples/dotnet
for the API.Net YouTube 3.0, I am doing something very similar, but using a VideoResource object, not a SearchResource. Code from the example:
YoutubeService youtube = new YoutubeService(new BaseClientService.Initializer() { ApiKey = credentials.ApiKey }); SearchResource.ListRequest listRequest = youtube.Search.List("snippet"); listRequest.Q = CommandLine.RequestUserInput<string>("Search term: "); listRequest.Order = SearchResource.Order.Relevance; SearchListResponse searchResponse = listRequest.Fetch();
Note that after setting the fields in the ListRequest object, the Fetch () method is called to initialize the SearchListResponse object. However, this Fetch () method is not part of the API! What gives? Does anyone know how to do listrequest so that it returns a ListReponse object?
source share