【问题标题】:How to filter YouTube Analytics API request for embedded video stats only如何仅过滤嵌入视频统计信息的 YouTube Analytics API 请求
【发布时间】:2019-12-21 07:57:20
【问题描述】:

我正在尝试从 YouTube 分析 API 中获取仅用于嵌入视频的数据。

当我使用“insightPlaybackLocationType==EMBEDDED”过滤器时,我收到不支持查询的响应。如果没有此过滤器,查询将返回没有任何错误的响应。

response = self.executeAPIRequest(
    yt_instance.reports().query,
    ids="channel==" + c_id,
    startDate=startdate,
    endDate=enddate,
metrics="views,likes,dislikes,comments,shares,estimatedMinutesWatched,averageViewDuration,averageViewPercentage",
    sort='-views',
    filters="video==VIDEO_ID_HERE;insightPlaybackLocationType==EMBEDDED",
    maxResults=200,
)

这是我得到的错误:

googleapiclient.errors.HttpError:https://youtubeanalytics.googleapis.com/v2/reports?ids=channel%3D%CHANNEL_ID_HERE&startDate=2017-02-28&endDate=2019-08-11&metrics=views%2Clikes%2Cdislikes%2Ccmets %2Cshares%2CestimatedMinutesWatched%2CaverageViewDuration%2CaverageViewPercentage&sort=-views&filters=video%3D%VIDEO_ID_HERE%3BinsightPlaybackLocationType%3D%3DEMBEDDED&maxResults=200&alt=json 返回“不支持查询。请查看https://developers.google.com/youtube/analytics/v2/available_reports 的文档以获取支持的查询列表。” >

【问题讨论】:

    标签: youtube-analytics-api


    【解决方案1】:

    该过滤器只能与insightPlaybackLocationDetail 维度一起使用。 请注意,该维度仅支持 viewsestimatedMinutesWatched 指标。

    文档(播放位置详细信息): https://developers.google.com/youtube/analytics/channel_reports#playback-location-reports

    请务必为此维度正确设置sortmaxResults 参数。

    【讨论】:

      猜你喜欢
      • 2018-02-03
      • 2014-11-29
      • 2013-09-03
      • 2013-10-11
      • 1970-01-01
      • 2013-09-21
      • 2018-11-24
      • 2014-05-27
      • 2017-12-06
      相关资源
      最近更新 更多