I am trying to use youtube data api to get all videos from a channel. But it didn't work for a particular channel. (It works for several other channels.)
As you can see from the screenshot, this channel has 135 videos.
However, I used playlistitems and search api, as below. They only return 9 videos. What is the problem here? Thanks.
GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=UUhTMiw43iw4w-ggOEXmPtfg&key={YOUR_API_KEY}
GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UChTMiw43iw4w-ggOEXmPtfg&maxResults=50&type=video&key={YOUR_API_KEY}
Basically you're dealing with two different channels with the same
title
but this is acceptable because of thecustomUrl
s are different, here the details:1.
DharmaYogaCenter
: UChTMiw43iw4w-ggOEXmPtfg - title: DharmaYogaCenterGET https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=UChTMiw43iw4w-ggOEXmPtfg&key={YOUR_API_KEY}
You can check there are only few videos in here: uploaded videos in channel UC8hnoz74NP5V5sxkuxXk2kA
"youtube#channel"
"id": UChTMiw43iw4w-ggOEXmPtfg
GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=UChTMiw43iw4w-ggOEXmPtfg&key={YOUR_API_KEY}
get the playlist id of channel's"uploads": "UUhTMiw43iw4w-ggOEXmPtfg"
uploads playlist:
UUhTMiw43iw4w-ggOEXmPtfg
"totalResults": 9GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=UUhTMiw43iw4w-ggOEXmPtfg&key={YOUR_API_KEY}
2.
TheDharmaTube
: UC8hnoz74NP5V5sxkuxXk2kA - title: DharmaYogaCenterGET https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=UC8hnoz74NP5V5sxkuxXk2kA&key={YOUR_API_KEY}
You can check there are a lot more videos in here: uploaded videos in channel UC8hnoz74NP5V5sxkuxXk2kA ..scroll down once opened to load all the videos
"youtube#channel"
"id": UC8hnoz74NP5V5sxkuxXk2kA
GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=UC8hnoz74NP5V5sxkuxXk2kA&key={YOUR_API_KEY}
get the playlist id of channel's"uploads": "UU8hnoz74NP5V5sxkuxXk2kA"
uploads playlist:
UU8hnoz74NP5V5sxkuxXk2kA
"totalResults": 142GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=UU8hnoz74NP5V5sxkuxXk2kA&key={YOUR_API_KEY} "totalResults": 142,