10

The YouTube channels can have lists of several "related" channels. For example, the Music channel has related Genre channels: Hip Hop, Pop, Rock, Country, etc.

Music Channel: http://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ

Related Channels to the Music Channel: http://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ/channels

I can retrieve a list of videos within a channel using the youtube.search.list API and I can fetch data of specific channels using youtube.channels.list API but I can't seem to find any API that gives me "other channels related to channel" like in the example above.

I'm pretty sure I took a look at all the APIs google is providing https://developers.google.com/apis-explorer/#p/youtube/v3/

Is there anyway I can fetch the data I need?

Jiho Kang
  • 2,482
  • 1
  • 28
  • 38

1 Answers1

11

In the API, what you are looking for is a ChannelSection with the type multipleChannels.

Using your example of the Music channel, I was able to

1) Pull a list of all channelSections

2) Find the id of the channelSection whose type is multipleChannels and title is Music Genres (all of the way at the bottom of the linked example).

3) Using the ID from step 2 you can now Query that specific channelSection

In my examples I used snippet for step 1 which gives you type and title. You could also use contentDetails for the part field which would cut down a step, but you'd have to search through the returned list whose contentDetails contained a channels array.

Edit:

To get details for the sub-channels you can join the channel IDs together as a comma separated list and use them as the id parameter in a channels.list query. Here is a query returning details for the top 3 channels returned from step 3.

davidmdem
  • 3,763
  • 2
  • 30
  • 33
  • Awesome, thanks so much. So it looks like I'd have to make an additional query using the channel IDs in the returned array in order to get the title strings? – Jiho Kang Nov 20 '14 at 03:34
  • Yes, that's correct. You can call the channels.list query with a comma separated list of the IDs for those sub-channels. I put an example call with the top 3 sub-channels in an edit. – davidmdem Nov 20 '14 at 14:48
  • Thanks for the answer. This doesn't seem to work for 3rd party channels such as CNN or ABCNews. For example, CNN has a list of "Related Channels" on their YouTube page, but step #1 of your answer doesn't return a multipleChannels list for CNN. Do you know how to get related channels for CNN ? – chow Nov 25 '14 at 17:57
  • Since CNN is a User and not a built in channel, it's a little different. You have to get the channel ID(s) for the username CNN from `channels.list`. From there, the thing that show up in CNN's channel tab are actually subscriptions that you can pull via `subscriptions.list`. – davidmdem Nov 26 '14 at 14:03