w.donahue
w.donahue

Reputation: 10906

Get videos on special (curated) channels

I am using the YouTube V3 API and attempting to get the list of videos on the channel #PopularOnYouTube. For all regular channels this works easily by using the search API and providing the channelId parameter. But for some reason these special YouTube curated channels do not behave like all the other YouTube channels. Is their some special way you have to go about getting the list of videos on these special channels?

This also replicated (does not work) when using their API explorer, but will work fine for regular channels.

Upvotes: 1

Views: 442

Answers (2)

not_a_bot
not_a_bot

Reputation: 2372

It took some doing, but I think I found the answer. Since a curated channel's videos aren't necessarily considered to be "uploaded", you have to look for its channel sections as opposed to an upload playlist.

https://www.googleapis.com/youtube/v3/channelSections?part=snippet,contentDetails,id&channelId=UCF0pVplsI8R5kcAqgtoRqoA&key=API_KEY

From this, I get the playlist ID based on the channel's "Popular right now" channel section (which had channelSection ID UCF0pVplsI8R5kcAqgtoRqoA.7e4CTK8-inw and is technically different from a playlist): PLrEnWoR732-BHrPp_Pm8_VleD68f9s14-.

Using that playlist ID, I made a playlistItems list request to get that playlist's videos:

https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,contentDetails,id&playlistId=PLrEnWoR732-BHrPp_Pm8_VleD68f9s14-&key=API_KEY

Hope this helps.

Upvotes: 1

Shimmbo
Shimmbo

Reputation: 71

You can get PopularOnYoutube's playlist by using the search API, then you can use PlaylistItems:list to get the videos for each playlist

Upvotes: 0

Related Questions