Retrieve Channels-Tab from YouTube Channel via YouTube-API - youtube-api

As you may know some Content-Creators on YouTube not only got one Channel. Some Channels have a Channel-Tab where you can see the other channels hosted by the creator. I would like to get these channels, but unfortunately the YouTube-API can't retrieve the data via channels: list. Is there a parameter or another function how I can get this information?
Channel example: https://www.youtube.com/c/DunklerParabelritter/channels
Thank you in advance,
Aaron!

It seems that once again YouTube Data API v3 doesn't provide a basic feature.
I would recommend you to use my open-source YouTube operational API. Indeed by requesting the JSON document https://yt.lemnoslife.com/channels?part=channels&id=CHANNEL_ID the data you are looking for are in item["channelSections"].
Note that the channel id associated to the channel you shared is UCK4LDHLxBqiAtcwCm4z7DRg, so you would obtain:
{
"kind": "youtube#channelListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#channel",
"etag": "NotImplemented",
"id": "UCK4LDHLxBqiAtcwCm4z7DRg",
"channelSections": [
{
"title": "Mit Empfehlung des Dunklen!",
"sectionChannels": [
{
"channelId": "UCWZu-P34DVZUVrYAROU3Cmw",
"title": "Prinz",
"thumbnails": [
{
"url": "https:\/\/yt3.googleusercontent.com\/knQfgyidSRlVLQfAw64R9DFWmnQt3BwdJUaRW1zHEVRgLswRcR9lsan_S4tGe4BfYJyo9Jppbg=s48-c-k-c0x00ffffff-no-rj-mo",
"width": 48,
"height": 48
},
...
],
"videoCount": 128,
"subscriberCount": 111000
},
...
],
"nextPageToken": null
}
]
}
]
}

Related

Is possible somehow explore youtube videos by hashtag?

I have been looking at the YouTube API and I am wondering if it is possible somehow search YouTube videos by hashtags e.g.
I want explore YouTube video for hashtag #funny
I have read YouTube API documentation but I haven't found anything.
Search: list
Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.
In my experience this is a full text search on title and description of the video so assuming your hash tags are in the description you should be able to search on them.
Request
GET https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&q=%23funny&key={YOUR_API_KEY}
Response
{
"kind": "youtube#searchListResponse",
"etag": "\"RmznBCICv9YtgWaaa_nWDIH1_GM/wR5yPzOxAnu-87xJGtSkLXz_78Q\"",
"nextPageToken": "CBkQAA",
"regionCode": "DK",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 25
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "\"RmznBCICv9YtgWaaa_nWDIH1_GM/IByts9zZTVNkc5EfbIDTKpE6pf8\"",
"id": {
"kind": "youtube#video",
"videoId": "DODLEX4zzLQ"
},
"snippet": {
"publishedAt": "2017-06-17T10:03:47.000Z",
"channelId": "UCKy3MG7_If9KlVuvw3rPMfw",
"title": "WATCH and TRY TO STOP LAUGHING - Super FUNNY VIDEOS compilation",
"description": "Can you hold your laugh while watching these clips? :) Mix of best and funniest animal & human fails. We bet you will lose this laugh challenge. Anyways, what is your favorite clip? :) Hope...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/DODLEX4zzLQ/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/DODLEX4zzLQ/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/DODLEX4zzLQ/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Tiger Productions",
"liveBroadcastContent": "none"
}
},
This is the video it returned WATCH and TRY TO STOP LAUGHING - Super FUNNY VIDEOS compilation #funny is in the description.
You can try it yourself here Google Apis Explorer

Localization data missing from Youtube data API

I am currently using the Youtube data API trying to get localised subtitle data and while this works for most videos it isn't working for this one: https://www.youtube.com/watch?v=Q0FhXknxYj4. The video has Danish subtitles but when you use the API or API demo (setting part as localization) here: https://developers.google.com/youtube/v3/docs/videos/list there is no subtitle data.
Example response for working video:
{
"kind": "youtube#videoListResponse",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/zgsYC3imu6Fd_dFVfGFSGv4yads\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/3xUeT9GTC6osUJsmbTXqY1OMfsc\"",
"id": "S3YnYrcD1sQ",
"localizations": {
"da": {
"title": "København: Europas første markedsplads for byrelaterede data - Hitachi",
"description": "Hitachi skaber en datamarkedsplads for Danmarks hovedstad, der skal styrke innovationen.\n\nhttp://www.hitachi.eu/en/case_studies/city-data-exchange"
},
"en": {
"title": "Copenhagen: Europe's first city data exchange - Hitachi",
"description": "Hitachi is creating a data marketplace for Denmark's capital, to help power innovation.\n\nhttp://www.hitachi.eu/en/case_studies/city-data-exchange"
}
}
}
]
}
Example response for broken video (Q0FhXknxYj4):
{
"kind": "youtube#videoListResponse",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/UrnoPP0xkF1sGZFODge_h_h01KU\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/Y82zqHiktkqS1qFvTSCoJ5BEJas\"",
"id": "Q0FhXknxYj4"
}
]
}
Does anyone know why the API might not pull in the localisation data even though the subtitles are there?
Many thanks,
Emily
Your first example does not contain any subtitle data either. It only contains localizations of the video title and description.
You need to be using captions, not list, to list subtitle details.

Find out if youtube video is GEMA protected

I am looking to find out wether a video on youtube is blocked (in germany) because its GEMA protected. Ideally via the youtube API.
I would like to know if its protected before the player tells me so.
An example for an video which is GEMA protected (the protection only occurs with german ip):
https://www.youtube.com/watch?v=BgfcToAjfdc
You can check this in an HTTP request by using search.list and specifying part=contentDetails. contentDetails has a blocked section that gives you the region code of any countries where the video is blocked.
For example, for this video, you would call:
https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=BgfcToAjfdc&key=[API_KEY]
And you get:
{
"kind": "youtube#videoListResponse",
"etag": "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/wC5hYBNHuSGatyO7FsTaHrWY5HI\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/4dW1h00OUpXXhtaz2M71v9cXGsQ\"",
"id": "BgfcToAjfdc",
"contentDetails": {
"duration": "PT5M26S",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": false,
"regionRestriction": {
"blocked": [
"DE"
]
You can see in the blocked section that the video is blocked in Germany.

Searching Channel with Youtube API

I am using Youtube Data Api V3 in my iOS App. Can some body give me some example for search thing the some Channel by name.
I am trying in the following way but its not working
https://www.googleapis.com/youtube/v3/search/list?key={YOUR_API_KEY}&part=snippet&type=channel&q=AnimalPlanetTV
Can anybody help me how i can get the channel data by name
Thanks
For Searching AnyYoutube Channel
https://youtube.googleapis.com/youtube/v3/channels?part=snippet&q=yoursearchquery&key=yourkey
This is a live example
You need to use Channel list of API V3
The result is like that with snippet
{
"kind": "youtube#channelListResponse",
"etag": "\"gMjDJfS6nsym0T-NKCXALC_u_rM/RKAMAh1QnoE3ilYYcvWIqvcDEZo\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"gMjDJfS6nsym0T-NKCXALC_u_rM/MenmiFqQVVN5JQ9MJpC9gddZ4Lw\"",
"id": "UCkEBDbzLyH-LbB2FgMoSMaQ",
"snippet": {
"title": "Animal Planet",
"description": "Animal Planet is the world's only entertainment brand that immerses viewers in the full range of life in the animal kingdom with rich, deep content via multiple platforms and offers animal lovers and pet owners access to a centralized online, television and mobile community for immersive, engaging, high-quality entertainment, information and enrichment.",
"publishedAt": "2007-02-14T18:26:59.000Z",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/-FEsYkupUb-A/AAAAAAAAAAI/AAAAAAAAAAA/6SiqnVvRZJY/s88-c-k-no/photo.jpg"
},
"medium": {
"url": "https://yt3.ggpht.com/-FEsYkupUb-A/AAAAAAAAAAI/AAAAAAAAAAA/6SiqnVvRZJY/s240-c-k-no/photo.jpg"
},
"high": {
"url": "https://yt3.ggpht.com/-FEsYkupUb-A/AAAAAAAAAAI/AAAAAAAAAAA/6SiqnVvRZJY/s240-c-k-no/photo.jpg"
}
}
}
}
]
}

Youtube API v3 returning different or missing playlists

I'm having some problems with the v3 API when getting playlists by ID.
I have a javascript app that allows you to search for playlists (via a call to www.googleapis.com/youtube/v3/search) then save those playlists to one of several "devices", which is then persisted on the server. When you return, the page gets the devices and the list of Youtube playlist IDs associated. To display more details (name, image, etc), call(s) are made to www.googleapis.com/youtube/v3/playlists.
The problem is that /playlists doesn't seem to be returning valid playlists. The most bare-bones test-case is a call to:
https://www.googleapis.com/youtube/v3/playlists?key=KEY&part=id%2Csnippet&id=PL736C3116AD309B58
which returns
{
"kind": "youtube#playlistListResponse",
"etag": "\"5cYuq_ImPkYn_h2RKDdX8DHvM2g/T0etSAnItCRUAPOtHRCu92sMKQU\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": []
}
Note that it shows "totalResults: 1", but 0 actual results.
A call to the youtube website for the same playlist ID (http://www.youtube.com/playlist?list=PL736C3116AD309B58) shows a valid playlist.
This used to work.
I'm not authenticating with oauth, but I'm comparing the results against non-authenticated web requests or against the non-oauthed API searches.
I have no idea why this is the case, but when clicking on one of the videos in the playlist you linked to, it shows SP736C3116AD309B58 as the playlistId (notice the prepending SP instead of PL). However, I verified that the PL id was indeed to the one showing up in search...
But a call to this endpoint gives you the data you're looking for...
Call:
https://www.googleapis.com/youtube/v3/playlists?key={API_KEY}&part=id%2Csnippet&id=SP736C3116AD309B58
Response:
{
"kind": "youtube#playlistListResponse",
"etag": "\"5cYuq_ImPkYn_h2RKDdX8DHvM2g/iOZzhrEf1VYbGO25CZhT4ga_Gw4\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"id": "SP736C3116AD309B58",
"kind": "youtube#playlist",
"etag": "\"5cYuq_ImPkYn_h2RKDdX8DHvM2g/U04KGNFEmQkvMoEC7XrbSayIGUY\"",
"snippet": {
"publishedAt": "2009-04-21T15:23:31.000Z",
"channelId": "UCNYrK4tc5i1-eL8TXesH2pg",
"title": "Auto-Tune the News",
"description": "The only news you need has a bass line",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/hMtZfW2z9dw/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/hMtZfW2z9dw/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/hMtZfW2z9dw/hqdefault.jpg"
}
}
},
"status": {
"privacyStatus": "public"
}
}
]
}
Is there any reason you aren't just capturing this data in the actual Search call?

Resources