0
votes

API call:

https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel==UCs4uXj0TcstDHqhHDUWlINg&start-date=2016-10-02&end-date=2016-10-02&metrics=views%2ccomments%2clikes%2cdislikes%2cshares%2cestimatedMinutesWatched%2caverageViewDuration%2caverageViewPercentage%2cannotationClickThroughRate%2cannotationCloseRate%2csubscribersGained%2csubscribersLost

token:

ya29

.OAJc4bDrDoA6XVEmCI9KZK6rfIz68aXjibhZFQowWZxHJx7tt0qyvpxUryxtPZtN8IrN

1
What error are you getting? If you're not getting an error what response are you getting? Are you using a client library? Are you setting the token as a "Authorization" header with a value of "Bearer " and then your token value?matthewayne
I am not getting an error. The call simply returns no data.mschurr

1 Answers

0
votes

Observe the parameters I used in reports.query Try-it:

enter image description here

The correct format in the ids textfield is 'channel=={YOUR_CHANNEL_ID}'

The response will correspond to the order you enumerated your metrics. For example, the response to the parameters above was:

 "rows": [
  [
   201,   
   0,
   9
  ]
 ]

meaning:

201 - views
0 - likes
9 - comments

because my metrics textfield was in this order -> views,likes,comments.