How to get my channels list on Youtube? - youtube

I want to get all channels that I have on a youtube account.
For example I have 3 channels on a account.
What I've done:
Read the documentation on https://developers.google.com/youtube/v3/docs/channels/list.
Authenticate with my account
Send GET request to GET https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true&key={YOUR_API_KEY}
I got success response, without error. But I only get a channel. I expected to get all my channels (3 channels).
Is it possible to get all my channels? If possible what should I do to get it?

After sometime searching for the same question,
I found this YouTube API v3 get all channels associated with a logged in user
And that is true.
Apparently, Youtube has no user info, but a channel info. So, when a user gives you permission to read his/her Youtube info, you only got permission to read a specific channel info (the "mine" channel) that was selected on the Google Account permission page.
The other user's channels will be seen as any other channel.
btw, I am not 100% of this, that's what I understood after reading the Youtube Data Api V3.

Related

Can GET channel list with mine=true return more than one channel?

I am working on integrating our app with youtube and I need to get user's channel id after logging on. Is there any chance that, when using /youtube/v3/channels?part=id&mine=true endpoint, I will get more than 1 channel in result list?
I tried to create more channels using the same account, but it always resulted in creating new google account, and then having ALWAYS one channel in the result list. But maybe there is some kind of (legacy?) way to create more channels "attached" to the same google account.
No, because when you authenticate, you have to choose to which channel you want to be authorized. And the token will be valid only for that channel.

YouTube Data API returns channel for user without channel

I've got a YouTube user, which doesn't contain a YouTube channel. But the YouTube data API does return a channel, if I query the youtube.channels.list API method by using the "mine=true" attribute like in following example (1).
Example:
(1) Returns a channel (mine=true; by using OAuth):
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet%252CcontentDetails%252Cstatistics&mine=true&_h=5&
This query (1) returns a channel which contains a channelId. Now I'm trying to query for the playlists of this channel by using the previously returned channelId.
(2) Returns a 404 "channel not found" error
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.playlists.list?part=snippet&channelId=UCIReEy02ibumfYhQP3-0drQ&_h=4&
As described here it's possible to use a YouTube account without a channel but with limited functionality like using playlists:
With a Google Account, you can watch and like videos and subscribe to channels. However, without a YouTube channel, you have no public presence on YouTube. Even if you have a Google Account, you need to create a YouTube channel to upload videos, comment, or make playlists. You can use a computer or the YouTube mobile site to create a new channel.
What's the reason query (1) is returning a channel even if a YouTube account doesn't contain a channel?
BR
ninsky
[1] Returns a channel (mine=true; by using OAuth):
Because of every account on youtube itself a channel. They can do all the things they want like any channel can do e.g. upload videos. Also, we can make multiple channels under the same account.
[2] Doesn't return a channel (forUsername=UCIReEy02ibumfYhQP3-0drQ; by/without using OAuth):
Please make sure UCIReEy02ibumfYhQP3-0drQ is a valid username
I'm building something with the YouTube API. I've found a few oddities so far. The first thing is that a channel can have a title of 'blah blah - Topic' so you probably want to screen those out if you want to retrieve channels with their own content. If I'm right in my thinking, these are just channels with Playlists. Example: https://www.youtube.com/channel/UC6tQSWkTxbPNaJ_LQ-Ia6jQ/
Also be aware that channels don't have to have a unique title.
Finally there are many channels that return nothing from the API Channels.List method, even though they are channels. I'm still figuring these out. I don't think they are returned from searching through the API, but if you get your Channel IDs from another source then this could be an issue.

How to relate a Youtube Channel and its Google account after deprecation of "googlePlusUserId"?

The "googlePlusUserId" of the YouTube channel object has been deprecated in the last review of the Youtube Data API (June 13, 2016). From the YouTube Data API revision history:
The channel resource's contentDetails.googlePlusUserId property has been deprecated. Previously, the property was only present if the channel was associated with a Google+ profile. Following the deprecation, the property will no longer be included in any channel resources.
I was using this property to relate a YouTube channel with its Google account. By this way I was able to verify in my page that a user signed in with Google is the owner of a YouTube channel. So how to do it now without this property?
Use case
My use case is a web application which invites some YouTube Channels (users) to the website. Ideally this invitation must be with a direct email to the email of the user or a direct message to the YouTube Channel through the YouTube Data API. However, both options are not viable because it is impossible to retrieve the email and actually there is not a functionality to send direct messages to a YouTube Channel through the API. So to invite a YouTube channel we have to manually go to the YouTube Channel about page and send a message to the user with the link to join our page. This link is an URL with a token identifying this invite but we need to be sure that the user coming from this link is the owner of the YouTube channel which has been invited, so the only way is logging in with his YouTube channel account which is the Google account.
I hope I have explained it well, if you have any doubt ask me.
Thank you!
I found a solution. You can make another call to people/me Google+ API endpoint to get the id of currently logged Google user.
Here you can find more information about OAuth scope you have to to grant to the token for access to user's data.

Youtube channels from google+ id

With the youtube API, I can find my google+ id from my channel id
https://www.googleapis.com/youtube/v3/channels?id=...&part=contentDetails&key=...
Is there a way to find my list of channels using my g+ id ?
I've looked at this question Google API: Find a Users YouTube Channel and it seems that https://www.googleapis.com/plus/v1/people/...?key=... should return the list it but mine is pretty much empty.
There isn't any way to get a channel from someone else's G+ ID.
You can only get authorized user's channel (even when they sign in with G+), simple by calling channels->list with parameter mine=true.

Response message is forbidden when queried for video on youtube analytics api

I used the youtube analytics api console ([https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?][1]) to retrieve details of videos (from my channel), values for id : channel==4aYYO.... metrics : video .
The response I get is 403 Forbidden code: 403, message: "Forbidden
Can anyone point out if I am missing any permission ?
[1]: https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?
Channel ids begin with UC. Can you try UC4aYYO... and see if that works?
First, use the ChannelList method in the YouTube Data API to your Channel ID's. This must be an authenticated call, so click the Authorize Requests slider in the API explorer. Make sure you are logged in with the Google account which owns the channel.
API Explorer Query
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet&mine=true&_h=1&
Here is more explanation from Jeff at Google.
How do I get a list of YouTube channels, and associated channel URLs (user or channel), owned by an authenticated user

Resources