【发布时间】:2018-10-02 14:18:16
【问题描述】:
我正在尝试的是,使用分析 api v1 根据喜欢获取我的 Youtube 频道的前 10 个视频。
根据浏览量
获取GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2005-05-01&end-date=2014-06-30&metrics=estimatedMinutesWatched%2Cviews%2Clikes%2Cshares&dimensions=video&max-results=10&sort=-views&key={YOUR_API_KEY}
在 sort=-views 是排序因子的情况下使用此端点。
我正在使用相同的方式根据喜欢进行排序sort=-likes
但我收到错误响应
400 Bad Request
- Show headers -
{
"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."
}
}
通过点击和试用,我知道 sort=-views 和 sort=-estimatedMinutesWatched 正在工作,但其他的,例如喜欢、cmets 等不起作用。可能的原因是什么?还有其他方法吗?
【问题讨论】:
标签: php youtube youtube-api youtube-analytics-api