You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用频道OAuth令牌调用YouTube Reporting API获取营收报告的问题

解答

频道OAuth Token无法访问content_owner_*前缀的营收报告——这类报告属于内容所有者(CMS)级权限,仅能通过CMS OAuth Token配合对应partner ID调用获取。

若要通过频道Token获取自身的营收数据(与YouTube Analytics API频道级数据一致),无需设置onBehalfOfContentOwner参数(或设为None),此时返回的报告列表中,需筛选**channel_前缀**的营收相关类型,比如:

  • channel_ad_revenue_raw_a1
  • channel_estimated_revenue_a1

你之前传入任意值给onBehalfOfContentOwner时报错,是因为频道Token没有内容所有者权限,该参数仅对CMS Token生效,且必须传入内容所有者的partner ID。

修正后的调用示例

# 使用频道OAuth Token调用,无需指定onBehalfOfContentOwner
response = service.reportTypes().list(
    includeSystemManaged=True
).execute()

# 过滤出频道级营收相关报告
revenue_reports = [
    report for report in response['reportTypes'] 
    if report['id'].startswith('channel_') and 'revenue' in report['id']
]
print(revenue_reports)

核心要点

  • content_owner_*报告是面向多频道管理的内容所有者,用于汇总旗下所有频道的营收数据,频道Token无此权限。
  • 频道Token对应的channel_前缀营收报告,数据维度与YouTube Analytics API中频道级营收数据完全匹配,可满足单频道每日营收报告需求。

内容的提问来源于stack exchange,提问作者Tigran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 15:15:42