使用 youtube api 和 curl 获取所有频道信息

get all channel info with youtube api and curl

大家好,我正在仔细阅读 youtube api 文档并在此处看到此 json 片段:https://developers.google.com/youtube/v3/docs/channels#resource-representation

我看到了这个,想从我的 curl 代码中指定的 youtube 频道获取所有这些信息。到目前为止我写的是这样的:

curl "https://www.googleapis.com/youtube/v3/channels?part=statistics&id=[CHANNEL NAME]&key=[API KEY]"

但这只返回了 json 的一小部分,我认为它是 "statistics" 的一部分。

如果你们能帮上忙,那就太好了,谢谢。

要获取附加到给定频道的其他信息,请通过 part 参数提及您感兴趣的属性集,如 reference doc 所指定。

更新:

要获得所有可用信息,要传递给 curl 的 URL 将是:

https://www.googleapis.com/youtube/v3/channels?part=brandingSettings,contentDetails,contentOwnerDetails,id,localizations,snippet,statistics,status,topicDetails&id=[CHANNEL NAME]&key=[API KEY]

请注意,part 参数不包含 auditDetails,因为这需要额外的权限。