gpt4 book ai didi

google-api - 无法使用 youtube data api v3 获取 youtube channel 统计信息

转载 作者:行者123 更新时间:2023-12-03 05:28:28 25 4
gpt4 key购买 nike

我已经创建了 google 项目并在下面的 url 中使用了 youtube data api v3 key ,但没有获取 channel 统计信息。https://www.googleapis.com/youtube/v3/channels?parts=statistics&id=UCQ_jR_iUmDsR50GX33qWvog&key=AIzaSyBDEjJeaI2QEzNuFNrjPAsFHl1Jin9JWsw输出如下

  "kind": "youtube#channelListResponse",
"etag": "5PVGuDob8dxpfgpaJGWruEW8hV8",
"pageInfo": {
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#channel",
"etag": "Z0A5YSAnQtcEnTTvtERboPwQAk0",
"id": "UCQ_jR_iUmDsR50GX33qWvog"
}
]
}

最佳答案

假设您正在使用 channel.list我认为您应该检查您的代码,我刚刚使用您的相同请求对其进行了测试,并且从这里可以正常工作。 tryme
要求:

curl \
'https://www.googleapis.com/youtube/v3/channels?part=statistics&id=UCQ_jR_iUmDsR50GX33qWvog&key=[YOUR_API_KEY]' \
--header 'Accept: application/json' \
--compressed
回复
{
"kind": "youtube#channelListResponse",
"etag": "1a3o4gpa3kaJyNIWXi2yvRgmk4s",
"pageInfo": {
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#channel",
"etag": "S7lD_zHbbGaTaOHU3iEyjECpr0c",
"id": "UCQ_jR_iUmDsR50GX33qWvog",
"statistics": {
"viewCount": "488",
"commentCount": "0",
"subscriberCount": "2",
"hiddenSubscriberCount": false,
"videoCount": "13"
}
}
]
}
评论问题的回答者

How your project is able to access my youtube channel?


您正在使用授予对公共(public)数据访问权限的 API key 。这也是我正在做的事情。您 channel 上的统计数据是公开数据。

Like you testing it on browser it is working but I copy the same python code to my local machine and try to run it is promoting for key.


您没有发布您的代码,我无法帮助您。您所显示的内容显示了硬编码的 public key= 参数。

how to bypass or get rid of prompt?


我正在使用公共(public) api key ,没有提示作为其请求公共(public)数据。

关于google-api - 无法使用 youtube data api v3 获取 youtube channel 统计信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64256553/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com