How can I retrieve “channels within a channel” on YouTube API v3

流过昼夜 提交于 2019-12-05 02:44:13

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!