Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current user's profile information in YouTube Data API v3

Tags:

youtube-api

In V2 you could hit the /api/users/default path to get infomation such as the user's username. This is documented here: https://developers.google.com/youtube/2.0/developers_guide_protocol_profiles

In our migration to V3 I also need to be able to pull the users username, but can't find any documentation showing how to do so. Is this functionality replicated in V3, or is there another way to accomplish this task?

Thanks!

like image 284
cmwright Avatar asked Feb 19 '13 15:02

cmwright


2 Answers

In v3, user info is basically channel info. By doing a channels->list "https://developers.google.com/youtube/v3/docs/channels/list", you will get the information under 'snippet.channelId' "https://developers.google.com/youtube/v3/docs/channels#snippet.channelId"

like image 57
Ibrahim Ulukaya Avatar answered Jun 24 '23 08:06

Ibrahim Ulukaya


Youtube API v3 does not support user information any more. Use userinfo API.

set scope: https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/userinfo.profile (a space between scopes)

and get: https://www.googleapis.com/oauth2/v1/userinfo?access_token={access_token}

like image 41
MyounghoonKim Avatar answered Jun 24 '23 08:06

MyounghoonKim