youtube-analytics-api

Getting 'Forbidden error' when trying to execute youtube analytic API

我们两清 提交于 2019-12-04 23:11:47
I am receiving an error message when trying to execute youtube analytics API. A service error occurred: Error calling GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUCaayLD9i5x4MmIoVZxXSv_g&start-date=2016-08-01&end-date=2016-08-07&metrics=views&dimensions=7DayTotals : (403) Forbidden Here is my code: require_once __DIR__.'\google-api-php-client-1-master\src\Google\autoload.php'; require_once __DIR__.'\google-api-php-client-1-master\src\Google\Client.php'; require_once __DIR__.'\google-api-php-client-1-master\src\Google\Service\YouTube.php'; session_start(); $key

How to get top 10 videos from your channel with the views count included in the response

自闭症网瘾萝莉.ら 提交于 2019-12-04 21:38:37
So I have a ouath web app that connects to youtube. I use the youtube analytics calls to get information like number of subscribers from my channel. But right now I try to make a top 10 videos from my channel with the views count for every video included in the response. I use this documentation: Top videos for subscribed or unsubscribed viewers My call looks like this: $command = 'curl -H "Authorization: Bearer ' . $access_token . '" "https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=' . date('Y-m-d', strtotime('-31 days')) . '&end-date=' . date('Y-m-d',

YouTube Analytics API doesn't return ROWS for query for a specific video

风格不统一 提交于 2019-12-04 06:35:21
问题 I am using the YouTube Analytics API to get analytics for specific queries. For channel queries it works great. Problems occurred, when I execute a query for a specific video..like this (start is defined): /***************************** * deviceType-stats *****************************/ $optparams = array('dimensions' => 'deviceType', "filters" => "video==" . $videoId, ); $currentDate = date("Y-m-d", time()); $resDeviceTypes = $youtubeService->analytics->reports->query( "channel==" .

Error: “message”: “Login Required” when use Youtube Analytics API

不打扰是莪最后的温柔 提交于 2019-11-29 03:19:48
I am working with youtube api. when I hit this url " https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2015-01-01&end-date=2016-01-31&metrics=likes%2Cdislikes&key= {API Key} " it gives 401 { "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } } but I hited in the explorer " https://developers.google.com/apis-explorer/ ?" it working fine. How do I make the first request work? In your request you are sending key=