在设置param mySubscribers = true时,YouTube API v3会为所有频道列表查询返回subscriberCount值0。如果我使用替代的“channelId”或“mine”参数,则subscriberCount是准确的。
以下是对文档的引用: https://developers.google.com/youtube/v3/docs/channels/list
我设置的部分等于id和统计信息以简化获取频道信息。这是(beta)API的错误吗?
答案 0 :(得分:0)
我遇到同样的问题,现在您可以使用YouTube Data API v2来衡量此指标,如下所示:
http://gdata.youtube.com/feeds/api/users/{USER-ID-OR-USERNAME}?v=2&alt=json
从yt $ statistics-> subscriberCount
获取此指标答案 1 :(得分:0)
这对我有用。你在验证吗?如果你设置mySubscribers = true并且不设置mine = true(如果两者都设置为true则会出错),你应该得到一个列表。在该列表中应该是pageInfo - > totalResults,它应该告诉你数字。
以下是API Explorer正确调用的示例 (https://developers.google.com/youtube/v3/docs/channels/list#try-it):
获取https://www.googleapis.com/youtube/v3/channels?part=id%2Cstatistics&mySubscribers=true&key= {YOUR_API_KEY}
授权:持票人ya29.blahblah X-JavaScript-User-Agent:Google API Explorer
答案 2 :(得分:0)
Get Subscribers count by following way using V3 api
URLString =[NSString stringWithFormat:@"https://www.googleapis.com/youtube/v3/channels?part=id&mySubscribers=true&access_token=%@",accessToken]
Response
etag = "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/0_NpYsUUR0M4UrddABQ5GlAx0aA\"";
items = (
{
etag = "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/I5mDLVKzrHCsmda5ZyJOe_6dhQ0\"";
id = uhjUCDMMDlm9PwDGiMdfV7QeIRgasd;
kind = "youtube#channel";
},
{
etag = "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/kUNuk7bhfC8iuWaAUvnBzbv3ZdM\"";
id = hjvhUCdMacPC0kNs1h3O1amJ2Mdwnv;
kind = "youtube#channel";
}
);
kind = "youtube#channelListResponse";
pageInfo = {
resultsPerPage = 5;
totalResults = 3; ////// Subscribers Count
};
}