Youtube API receives Google+ ID from Youtube user

I have a youtube username and channel id with youtube.

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

I need to find a user associated with scottmillerstyle

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

I worked with an API browser, but could not find a solution in this direction.

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

+5
source share
1 answer

Perhaps, but only if the user authenticates with the application that you are developing.

Mark this answer:

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 following these steps:

Go to your URL: https://developers.google.com/youtube/v3/docs/channels/list

Scroll down to have a try! and input:

  Part: contentOwnerDetails forUsername: scottmillerstyle 

Click Run. He will ask for authentication and then show you the answer.

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

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

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

This will get the username, email address, a lot of details from the Google + ID ... But you don’t need to connect the dots between the YouTube ID and the Google+ ID. Google must rely on connectivity as a security risk. Let's see how I determined it.

Follow this link again:

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

Scroll down to have a try! and input:

  part: contentDetails mine: true 

Click Run. He will ask for authentication and the answer 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 the scottmillerstyle id:

  part: contentDetails forUsername: scottmillerstyle OR id:UC_VbgAPtgDGLyRMTEBqzRaA 

And you will get this result without a 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" } } } ] } 
+1
source

Source: https://habr.com/ru/post/1236179/


All Articles