如何在YouTube Data API v3中获取当前用户的个人资料信息

cmw*_*ght 10 youtube-api

在V2中,您可以点击/api/users/default获取信息的路径,例如用户的用户名.这在此处记录:https://developers.google.com/youtube/2.0/developers_guide_protocol_profiles

在我们迁移到V3时,我还需要能够提取用户名,但找不到任何显示如何操作的文档.此功能是否在V3中复制,还是有另一种方法可以完成此任务?

谢谢!

Ibr*_*aya 12

在v3中,用户信息基本上是频道信息.通过渠道 - >列表" https://developers.google.com/youtube/v3/docs/channels/list ",您将获得"snippet.channelId"下的信息" https://developers.google.com /youtube/v3/docs/channels#snippet.channelId "

  • 此外,channel.snippet.title下还有一个人类可读的显示名称 (2认同)

MKa*_*st3 5

Youtube API v3 不再支持用户信息。使用用户信息 API。

设置范围:(https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/userinfo.profile 范围之间有空格)

并得到:https://www.googleapis.com/oauth2/v1/userinfo?access_token={access_token}