YouTube Analytics API doesn't return ROWS for

2019-03-04 06:37发布

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==" . $videoendorsement->ytchannelid
            ,$startDate
            ,$currentDate
            ,"views,estimatedMinutesWatched"
            ,$optparams);

I don't get any result ROWS for this query, but only for some video Ids. For other video Ids it works. Btw: The videos where I don't get any result ROWS are online since 2 days on YouTube. Do I have to wait a little bit longer since I get a result from API?!

Overall there is additionally a problem to get demography and geography for any video. Doesn't matter which video Id I use, I don't get any result ROWS for demography and geography stats.

Does anybody know where the problem is?

1条回答
冷血范
2楼-- · 2019-03-04 06:58

When no results match the criteria specified, no rows are returned. For example, if you query for a range of dates prior to a video being published.

查看更多
登录 后发表回答