YouTube API V3 - Channel Required, can I programmatically create a YouTube channel? - youtube-api

The user isn't able to create a playlist unless they have a YouTube channel created on their Google account. Is there a way I can create the channel for them programmatically using JavaScript?

Unfortunately you can not create a new Channel (https://developers.google.com/youtube/v3/docs/channels) in the v3 api.
One possible work around is that you redirect your end user to https://www.youtube.com/create_channel .

Related

Programmatically get Current Playing YouTube Video

I want to authenticate user Google account and fetch currently playing video ID, title or URL. I looked into YouTube Data API and wasn't able to find any relevant endpoint. Is it possible to do the same?
Inspiration: https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/

Youtube Api's Private Videos

I have a scenario that, i have channel on youtube and I post a video as private. I have set permissions and invite to specific google email can see that video. how i can get that video using youtube apis by passing invited email.
I need process how I use to take a user email and private youtube video as inputs, and authorize just the specific user to view that video.
I want api example like below
https://www.googleapis.com/youtube/v3/playlists?key=googleKEY&maxResults=50&channelId=channelID&part=snippet&invited_email=sample#gmail.com
Thanks

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.

How to Upload videos to my channel on you tube from android?

Want to upload videos to my channel on youtube directly from android and iOS using youtube API v3.
I know "client login" of Youtube API v2 is now deprecated and cannot use any more now, but is there any method in V3 API that we can use now to achieve the video upload to my channel on youtube without user interaction or without user prompt to ask username or password?
Letting other people upload random videos to your channel is not recommended. That's why OAuth2 only lets them to upload to their own channel. You can use YouTube Direct Lite for people to upload to their channel, but you can still collect those videos into your playlist.
https://code.google.com/p/youtube-direct-lite/
https://github.com/youtube/yt-direct-lite-iOS
https://github.com/youtube/yt-direct-lite-android

Resources