我正在尝试使用他们的API获取我在其UI中看到的相同报告。
当我指定以下指标和维度时,查询不起作用:
但是,如果我将指标减少到:views,estimatedMinutesWatched查询工作正常。
以下是YouTube API出错时的回复:
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: X-Origin
Content-Type: application/json; charset=UTF-8
Date: Wed, 06 Jan 2016 09:01:17 GMT
Expires: Wed, 06 Jan 2016 09:01:17 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Content-Length: 461
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
}
],
"code": 400,
"message": "The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
}
}
答案 0 :(得分:0)
在使用无效过滤器或维度之前,我已经看到过此错误。我能够使用Google API资源管理器复制此问题,当我删除了“观看者”后,问题就消失了。度量。这很奇怪,因为它在YouTube文档中显示为受支持的核心指标:https://developers.google.com/youtube/analytics/v1/dimsmets/mets#viewerPercentage。我无法找到有关它被弃用的任何内容,所以我不确定其原因是否超出它,这似乎是Youtube Analytics API的问题。