YouTube API to fetch all videos on a channel

Rajendra Dewani picture Rajendra Dewani · Sep 23, 2013 · Viewed 242.3k times · Source

We need a video list by channel name of YouTube (using the API).

We can get a channel list (only channel name) by using the below API:

https://gdata.youtube.com/feeds/api/channels?v=2&q=tendulkar

Below is a direct link of channels

https://www.youtube.com/channel/UCqAEtEr0A0Eo2IVcuWBfB9g

Or

WWW.YouTube.com/channel/HC-8jgBP-4rlI

Now, we need videos of channel >> UCqAEtEr0A0Eo2IVcuWBfB9g or HC-8jgBP-4rlI.

We tried

https://gdata.youtube.com/feeds/api/videos?v=2&uploader=partner&User=UC7Xayrf2k0NZiz3S04WuDNQ https://gdata.youtube.com/feeds/api/videos?v=2&uploader=partner&q=UC7Xayrf2k0NZiz3S04WuDNQ

But, it does not help.

We need all the videos posted on the channel. Videos uploaded to a channel can be from multiple users thus I don't think providing a user parameter would help...

Answer

akshay picture akshay · Dec 27, 2013

You need to look at the YouTube Data API. You will find there documentation about how the API can be accessed. You can also find client libraries.

You could also make the requests yourself. Here is an example URL that retrieves the latest videos from a channel:

https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20

After that you will receive a JSON with video ids and details, and you can construct your video URL like this:

http://www.youtube.com/watch?v={video_id_here}