Youtube API get Google+ ID from Youtube User Name

Andrew Woodard

I have a youtube username and channel ID from youtube.

https://www.youtube.com/user/scottmillerstyle

I need to find the user associated with scottmillerstyle

Is there a way to use the YouTube data API to access the Google+ user name of the person who set up the channel?

I've been working with the API explorer but haven't been able to find a solution in this direction.

https://developers.google.com/youtube/v3/docs/channels/list

Kyle Burkett

It's possible, but only if the user authenticates using an app you develop.

Check out this response:

 cache-control:  private, max-age=0, must-revalidate, no-transform
 content-encoding:  gzip
 content-length:  255
 content-type:  application/json; charset=UTF-8
 date:  Thu, 18 Feb 2016 19:15:40 GMT
 etag:  "DsOZ7qVJA4mxdTxZeNzis6uE6ck/Oq_w72Shc0Jbz1xT23RTCTTrK_w"
 expires:  Thu, 18 Feb 2016 19:15:40 GMT
 server:  GSE
 vary:  Origin, X-Origin
 {
   "kind": "youtube#channelListResponse",
   "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/Oq_w72Shc0Jbz1xT23RTCTTrK_w\"",
   "pageInfo": {
   "totalResults": 1,
   "resultsPerPage": 5
  },
  "items": [
   {

    "kind": "youtube#channel",
    "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/MmJKFbszvNpjgkX8YAJ4HGIfQ5E\"",
    "id": "UC_VbgAPtgDGLyRMTEBqzRaA"
   }
  ]
 }

You can duplicate this by doing the following:

Visit the URL you provided: https://developers.google.com/youtube/v3/docs/channels/list

Scroll down to Try it! and input:

 Part:            contentOwnerDetails
 forUsername:     scottmillerstyle

Hit Execute. It will ask for authentication and then show you the response.

Here Youtube documents Channel ID = (UC + User ID) https://support.google.com/youtube/answer/3250431?hl=en

So now you know the YouTube user ID is _VbgAPtgDGLyRMTEBqzRaA. So now we have to figure out how to translate YouTube user ID into Google+ ID...

I found this: https://developers.google.com/+/web/api/rest/latest/people/get

This will get Username, Email, Lots of Details from a Google+ ID... But there is nothing left to connect the dots between the YouTube ID and the Google+ ID. Google must deem the connection a security risk. Lets take a look at how I determined this.

Visit this link again:

https://developers.google.com/youtube/v3/docs/channels/list

Scroll down to Try it! and input:

 part: contentDetails
 mine: true

Hit Execute. It will ask to authenticate and the response will show:

 200 OK
 - SHOW HEADERS -
 {
  "kind": "youtube#channelListResponse",
  "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/KzUqsPYNzzdoMWr6xkZBKK1GNNg\"",
  "pageInfo": {
   "totalResults": 1,
   "resultsPerPage": 1
  },
  "items": [
   {

    "kind": "youtube#channel",
    "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/IR1I4xHnZMxcbo2sT4BipUVBl-Y\"",
    "id": "UCkoYb87EdaF5XepEa5EmSgQ",
    "contentDetails": {
     "relatedPlaylists": {
      "likes": "LLkoYb87EdaF5XepEa5EmSgQ",
      "favorites": "FLkoYb87EdaF5XepEa5EmSgQ",
      "uploads": "UUkoYb87EdaF5XepEa5EmSgQ",
      "watchHistory": "HLkoYb87EdaF5XepEa5EmSgQ",
      "watchLater": "WLkoYb87EdaF5XepEa5EmSgQ"
     },
     "googlePlusUserId": "YOUR GOOGLE+ ID! FANTASTIC!"
    }
   }
  ]
 }

Now try the same thing, but to get scottmillerstyle ID:

 part: contentDetails
 forUsername: scottmillerstyle
          OR
 id:UC_VbgAPtgDGLyRMTEBqzRaA

And you get this result with no Google+ ID

 200 OK
 - SHOW HEADERS -
 {
  "kind": "youtube#channelListResponse",
  "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/zi31_NL3JJhpDcdJWbxbZE-0Ik8\"",
  "pageInfo": {
   "totalResults": 1,
   "resultsPerPage": 1
  },
  "items": [
   {

    "kind": "youtube#channel",
    "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/8iJ_z543bWUuMxbs2hC_VTdTvZI\"",
    "id": "UC_VbgAPtgDGLyRMTEBqzRaA",
    "contentDetails": {
     "relatedPlaylists": {
      "likes": "LL_VbgAPtgDGLyRMTEBqzRaA",
      "uploads": "UU_VbgAPtgDGLyRMTEBqzRaA"
     }
    }
   }
  ]
 }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to get Channel Id from Youtube Api ? it shows this error " JSONException: No value for channelId"

How do I get a YouTube video thumbnail from the YouTube API?

Get youtube username from channel id

Get all playlist ids from channel id - youtube api v3

How to get watched history of youtube user using Youtube Javascript API?

How to get user links through YouTube API?

Youtube API - no channel name

How can I get a Youtube video ID from the Youtube API given the video url?

Youtube API - Get duration of videos from a playlist

Youtube API v3 get every Video ID from given channel

Get YouTube Banner from YT API JSON

Youtube API v3 get the Channel ID of user that uploaded a certain video

Lookup user's YouTube Account with Google Id

Youtube API - Get notes from videos?

How to get metrics from YouTube Analytics API for every video which belongs to current user?

youtube API get all playlist id from a channel : python

Youtube Data API: Get latest video ID from channel excluding live streams

Get request in Youtube API

Get youtube video id from youtube url in smarty template?

Get user name with Youtube Data API 3.0

Get videos from youtube api from channel

How to access youtube json date from the youtube google api?

get all playlist of an user from YouTube. working in api explorer but not in c#

Get YouTube channel information with Google API in Java

Getting YouTube Video ID from user-supplied search term using YouTube API

How to get the YouTube channel name from the url

How to get the title of a playlist from the YouTube API

youtube channel ID or name from URL

Problem with YouTube Data API to retrieve user's channel Id