We are succesful to log into the API, although, the response does not match the data existing in the channel. The reports available in the YouTube Studio do offer the correct information. But our goal is to automate this report generation using the API.
We authenticate via oAuth 2.0, since that is what we need to use certain API calls.
Also, the "videos" dimension does not work.
We are doing our tests using Postman
This is our query:
and this is the result:
{"kind": "youtubeAnalytics#resultTable","columnHeaders": [{"name": "video","columnType": "DIMENSION","dataType": "STRING"},{"name": "views","columnType": "METRIC","dataType": "INTEGER"},{"name": "comments","columnType": "METRIC","dataType": "INTEGER"},{"name": "likes","columnType": "METRIC","dataType": "INTEGER"},{"name": "dislikes","columnType": "METRIC","dataType": "INTEGER"},{"name": "videosAddedToPlaylists","columnType": "METRIC","dataType": "INTEGER"},{"name": "videosRemovedFromPlaylists","columnType": "METRIC","dataType": "INTEGER"},{"name": "shares","columnType": "METRIC","dataType": "INTEGER"}],"rows": []}
This is not correct, there should be one video with different values for those metrics.
Without the dimension video, this is our query:
And this is the answer:
{"kind": "youtubeAnalytics#resultTable","columnHeaders": [{"name": "views","columnType": "METRIC","dataType": "INTEGER"},{"name": "comments","columnType": "METRIC","dataType": "INTEGER"},{"name": "likes","columnType": "METRIC","dataType": "INTEGER"},{"name": "dislikes","columnType": "METRIC","dataType": "INTEGER"},{"name": "videosAddedToPlaylists","columnType": "METRIC","dataType": "INTEGER"},{"name": "videosRemovedFromPlaylists","columnType": "METRIC","dataType": "INTEGER"},{"name": "shares","columnType": "METRIC","dataType": "INTEGER"}],"rows": [[0,0,0,0,0,0,0]]}
Different, since at least it returns zeroes instead of nothing, but not quite.
What are we doing wrong?
Thanks!