更新时间:2023-01-18 14:04:25
我做到了,感谢 Mike Meinz 和 Visual Studio 调试工具这里是在 VB.NET 中使用 *** Data API 获取一些频道(不是你的)数据的代码:
I did it, thanks to Mike Meinz and th Visual Studio debugging tools Here the code to get some channels (not necessary yours) data using *** Data API in a VB.NET:
Dim ***_api_key As String = "Your_Key"
Dim ***_api_application_name As String = "Your_Project_Name_In_the_Google_Developper_Console"
Dim ***_initialiser As New Google.Apis.Services.BaseClientService.Initializer()
***_initialiser.ApiKey = ***_api_key
***_initialiser.ApplicationName = ***_api_application_name
Dim ***_service As Google.Apis.***.v3.***Service = New ***Service(***_initialiser)
Dim objChannelListRequest As ChannelsResource.ListRequest = ***_service.Channels.List("id,snippet,statistics")
objChannelListRequest.Id = ***_channel
Dim objChannelListResponse As ChannelListResponse = objChannelListRequest.Execute()
Debug.Print(objChannelListResponse.Items(0).Snippet.Description)
Debug.Print(objChannelListResponse.Items(0).Statistics.SubscriberCount)
Debug.Print(objChannelListResponse.Items(0).Statistics.VideoCount)
Debug.Print(objChannelListResponse.Items(0).Statistics.ViewCount)