Using the Youtube Data API's Channels:list with the brandingSettings
part works when using the id
filter but not the forUsername
filter for me.
For example, GET https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&forUsername=h3h3Productions&key={YOUR_API_KEY}
results in the following, which is missing brandSettings:
{
"kind": "youtube#channelListResponse",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/Qagk6ayL_umilQ398UZyAHwxK_g\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/tTzKQvYs0Y2GpqN2wqgudxB2TnQ\"",
"id": "UCDWIvJwLJsE4LG1Atne2blQ"
}
]
}
But GET https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&id=UCDWIvJwLJsE4LG1Atne2blQ&key={YOUR_API_KEY}
(which you'll notice uses the ID of the same user), leaves it intact:
{
"kind": "youtube#channelListResponse",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/2ZOHdezDOZFRR9xisREY04R4OOg\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/58_5G5_Hi-64MiC8m5NC76sDIOA\"",
"id": "UCDWIvJwLJsE4LG1Atne2blQ",
"brandingSettings": {
"channel": {
"title": "h3h3Productions",
"description": "Wacky, zany, goofy comedy. ",
"keywords": "comedy humor satire parody funny sketch \"sketch comedy\" reaction \"reaction video\" review h3h3 h3h3productions",
"showRelatedChannels": true,
"showBrowseView": true,
"featuredChannelsTitle": "SECOND CHANNEL",
"featuredChannelsUrls": [
"UC7pp40MU_6rLK5pvJYG3d0Q"
],
"unsubscribedTrailer": "tVaAv0cPRok",
"profileColor": "#000000",
"country": "US"
},
"image": {
"bannerImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1060-fcrop64=1,00005a57ffffa5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerMobileImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w640-fcrop64=1,32b75a57cd48a5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTabletLowImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1138-fcrop64=1,00005a57ffffa5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTabletImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1707-fcrop64=1,00005a57ffffa5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTabletHdImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w2276-fcrop64=1,00005a57ffffa5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTabletExtraHdImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w2560-fcrop64=1,00005a57ffffa5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerMobileLowImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w320-fcrop64=1,32b75a57cd48a5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerMobileMediumHdImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w960-fcrop64=1,32b75a57cd48a5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerMobileHdImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1280-fcrop64=1,32b75a57cd48a5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerMobileExtraHdImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1440-fcrop64=1,32b75a57cd48a5a8-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTvImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w2120-fcrop64=1,00000000ffffffff-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTvLowImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w854-fcrop64=1,00000000ffffffff-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTvMediumImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1280-fcrop64=1,00000000ffffffff-nd/youtube%2Bnew%2Bbanner14.jpg",
"bannerTvHighImageUrl": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w1920-fcrop64=1,00000000ffffffff-nd/youtube%2Bnew%2Bbanner14.jpg"
},
"hints": [
{
"property": "channel.banner.mobile.medium.image.url",
"value": "https://yt3.ggpht.com/-DFbgqVWqgm8/VDV_M-xkJtI/AAAAAAAAAOE/zQeoRrTR-qA/w640-fcrop64=1,32b75a57cd48a5a8-nd/youtube%2Bnew%2Bbanner14.jpg"
},
{
"property": "channel.banner.image_height.int",
"value": "0"
},
{
"property": "channel.featured_tab.template.string",
"value": "Everything"
},
{
"property": "channel.modules.show_comments.bool",
"value": "True"
}
]
}
}
]
}
Am I doing something wrong? Keeping everything the same but switching the part to snippet
or statistics
works how you'd expect in both cases. I've also tried this on a few more channels and get the same results.
I think this is working as intended. See YouTube API - No channel branding settings returned for queries by username. Tl;dr: even though you can look for channels by using their usernames, the migration from V2 carried with it the fact that not every YouTube channel has a unique username, so that's why it works correctly when you use the channel ID (which is unique). I also tried it by specifying forMine
instead of the channel ID and it worked as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With