Reputation: 283
I am authenticating with google to try and get youtube analytics my problem is that i don't know how to filled you the parameters when quering youtube here i am making a new service: and then try to query it
I am not sure what to put in the "ids" parameter or where to find it? What do I put there?
_analyticService = new YoutubeAnalyticsService(_authenticator = CreateAuthenticator()); ... _analyticService.Reports.Query("ids", "2013-01-01", "2013-02-02", "views").Fetch();
Upvotes: 0
Views: 331
Reputation: 2526
The ids parameter is the an expression with the id of your channel. If you go to http://www.youtube.com/analytics and click on the title with your own channel name, you get a link like http://www.youtube.com/channel/UCYHMS8hN8s49F93iJuEgG6w The last part is the id of your channel. You have to use this as the ids parameter in an expression like "channel==UCYHMS8hN8s49F93iJuEgG6w". This is to query in the context of your own channel. This is needed as you might have access to several channels.
I can query views for one of my videos by: https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUCYHMS8hN8s49F93iJuEgG6w&start-date=2013-01-01&end-date=2013-02-02&metrics=views&dimensions=day&filters=video%3D%3D_iwmv6644dA&sort=day&key={YOUR_API_KEY}
Try to use the API explorer at the bottom of this page, there are some text explaining the different parameters there as well. https://developers.google.com/youtube/analytics/v1/
Hope it goes well!
Upvotes: 1