一旦某个频道已获得授权,是否有办法按观看次数查询前X个国家/地区?

时间:2013-08-19 14:32:07

标签: youtube-api

我能找到的只有:https://developers.google.com/youtube/analytics/sample-requests#channel_country_viewcounts

这样做意味着我们必须查询世界上的每个国家,然后排序。

1 个答案:

答案 0 :(得分:0)

您可以在内容所有者报告和频道报告中按频道提取热门国家/地区。我已经在下方显示了如何获取报告的链接。

频道报道

文档(查看“国家/地区”维度报告): https://developers.google.com/youtube/analytics/v1/channel_reports#Reports

API Explorer(无需编写代码即可测试API调用的绝佳工具): https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?ids=channel%253D%253DCHANNEL_ID&start-date=2010-03-01&end-date=2013-07-31&metrics=views%252CestimatedMinutesWatched%252CaverageViewDuration%252CaverageViewPercentage%252CsubscribersGained&dimensions=country&sort=-estimatedMinutesWatched&_h=3&

API请求: 得到 https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DCHANNEL_ID&start-date=2010-03-01&end-date=2013-07-31&metrics=views%2CestimatedMinutesWatched%2CaverageViewDuration%2CaverageViewPercentage%2CsubscribersGained&dimensions=country&sort=-estimatedMinutesWatched&key= {YOUR_API_KEY}

内容所有者报告

内容所有者报告文档(选中“国家/地区”维度报告): https://developers.google.com/youtube/analytics/v1/content_owner_reports#Reports

API Explorer链接(无需编写代码即可测试API调用的绝佳工具): https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?ids=contentOwner%253D%253DCMS_ID&start-date=2009-01-27&end-date=2013-08-08&metrics=views&dimensions=country&filters=channel%253D%253DCHANNEL_ID&sort=-views&_h=3&

这是HTTP请求: 得到 https://www.googleapis.com/youtube/analytics/v1/reports?ids=contentOwner%3D%3DCMS_ID&start-date=2009-01-27&end-date=2013-08-08&metrics=views&dimensions=country&filters=channel%3D%3DCHANNEL_ID&sort=-views&key= {YOUR_API_KEY}