How to get a User's Youtube handle after they sign in with Google? - youtube

Is there an API to retrieve a user's Youtube handle as of today?
cannot find anything in Youtube Data API doc.

One more time YouTube Data API v3 doesn't provide a basic feature. As handle isn't found for channel handles in YouTube Data API v3 revision history, while it's a recent feature.
I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/channels?part=about&id=CHANNEL_ID, you will get the channel handle you are looking for in item["about"]["handle"].
For instance for UCQxJsAlqmBPAbR_0syDi9mg you would get:
{
"kind": "youtube#channelListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#channel",
"etag": "NotImplemented",
"id": "UCQxJsAlqmBPAbR_0syDi9mg",
"about": {
...
"handle": "#Fairphone"
}
}
]
}

Related

how to map youtube handles to channel IDs

Youtube recently rolled out handles feature where they gave users youtube.com/#xxx type usernames, when visited these URLs show user's channel but I can't find any documentation or reference in API repositories.
How to extract youtube user channel ID from their handle?
One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/channels?handle=#HANDLE you will get the YouTube channel id you are looking for in item["id"].
For instance with the YouTube channel handle #WHO, you would get:
{
"kind": "youtube#channelListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#channel",
"etag": "NotImplemented",
"id": "UC07-dOwgza1IguKA86jqxNA"
}
]
}

How to detect official artist channel using youtube api?

How to detect is it official artist channel or not, using youtube api? Official channel has special label next to title, like this one https://www.youtube.com/channel/UCBQZwaNPFfJ1gZ1fLZpAEGw, but it doesn't appear in title from api.
One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/channels?part=approval&id=CHANNEL_ID, you will get whether or not the given channel is an official artist in item["approval"] by checking if this value is Official Artist Channel.
For instance the YouTube channel UC0aMaqIs997ggjDs_Q9UYiw is an official artist channel, with this channel id you would get:
{
"kind": "youtube#channelListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#channel",
"etag": "NotImplemented",
"id": "UC0aMaqIs997ggjDs_Q9UYiw",
"approval": "Official Artist Channel"
}
]
}

YouTube Data API channels list returning no results for valid Channel ID

I'm attempting to access https://www.youtube.com/channel/UC7LoiySz7-FcGgZCKBq_2vQ via the YouTube Data API v3 however am not able to load channel by id:
https://content.googleapis.com/youtube/v3/channels?part=snippet&id=UC7LoiySz7-FcGgZCKBq_2vQ&key=<omitted>
{
"kind": "youtube#channelListResponse",
"etag": "\"XI7nbFXulYBIpL0ayR_gDh3eu1k/Rk41fm-2TD0VG1yv0-bkUvcBi9s\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 0
},
"items": []
}
other channels that this same error occurs for:
https://www.youtube.com/channel/UCzwNZaQ2qyZw0n3xOSNoXaQ
https://www.youtube.com/channel/UC0iFwqagVPP6pXiDwYU170g
Your channels are of type hidden. This is the expected outcome. Unhide it and work your way from there.
Delete or hide your YouTube channel:
You can hide content from your YouTube channel and choose to re-enable
it later. When you hide content, your channel name, videos, likes,
subscriptions, and subscribers will be made private.
All your comments and replies will be permanently deleted. Your
account data on other Google properties will not be removed.
One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/channels?part=status&id=CHANNEL_ID, you will get the YouTube channel status message you are looking for in item["status"].
For instance with this channel id UC7LoiySz7-FcGgZCKBq_2vQ you would get:
{
"kind": "youtube#channelListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#channel",
"etag": "NotImplemented",
"id": "UC7LoiySz7-FcGgZCKBq_2vQ",
"status": "This channel is not available."
}
]
}
For a suspended YouTube channel such as UCF_UozwQBJY4WHZ7yilYkjA, you would get for status: "This account has been terminated due to multiple or severe violations of YouTube's policy on nudity or sexual content.".
For a normal channel, such as UC4QobU6STFB0P71PMvOGN5A, you would get for status: null.

not getting result from youtube channel:list api

I am using youtube data api (GET https://www.googleapis.com/youtube/v3/channels?part=snippet&categoryId=GCQ29va2luZyAmIEhlYWx0aA&maxResults=5&key={YOUR_API_KEY}). but getting no channel list in response. tried for so many categoryId's from different regionCode.
response from youtube api - 200
{
"kind": "youtube#channelListResponse",
"etag": "Wu2llbfqCdxIVjGbVPm2DslKPCA/ewwRz0VbTYpp2EGbOkvZ5M_1mbo",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": [
]
}
Looks like you copy pasted the URI
GET https://www.googleapis.com/youtube/v3/channels
,attached an API_KEY then pasted it on your browser.
What I would recommend is use the Try-it for testing then use OAuth for authorization when actually coding the app. You can see several Quickstarts in the Youtube Guide.

Find the youtube channel id for Google+ development or any other reason

Find the channel id for a youtube channel in case you want to subscribe to it or for any other purpose.
Let's say you want to let the users subscribe to the client application's youtube channel by clicking subscribe. The user would have to sign in to Google+ and then run an api request to subscribe. So for this scenario you would need the channel id.
Please note that the new way of doing things is Google+ instead of GData
Go to the following link and replace the username of that channel[foofightersVEVO with the username of that channel]
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=id&maxResults=1&q=foofightersVEVO&type=channel&_h=3&
execute the query and look at the api response:
GET https://www.googleapis.com/youtube/v3/search?part=id&maxResults=1&q=foofightersVEVO&type=channel&key={YOUR_API_KEY}
X-JavaScript-User-Agent: Google APIs Explorer
{
"kind": "youtube#searchListResponse",
"etag": "\"2vd4g3cVsHAtTjJSdUMaBo1PBVE/6Ux-QcH6OQdn3t89j3y5z9RQhv0\"",
"pageInfo": {
"totalResults": 161878,
"resultsPerPage": 1
},
"nextPageToken": "CAEQAA",
"items": [
{
"kind": "youtube#searchResult",
"etag": "\"2vd4g3cVsHAtTjJSdUMaBo1PBVE/Q9-widOQXafayJk0l2DV9nrMYO0\"",
"id": {
"kind": "youtube#channel",
"channelId": "UCGRjJrpD2bmk9Ilq6nq80qg"
}
}
]
}
Note the channelId there. Hope this helps.

Resources