user7160306 user7160306 - 18 days ago 6
Android Question

How to list all the videos in a youtube channel using android studio.

I am building an android app to list all videos from a particular youtube channel.Can anybody give me the code to for that.

Answer

You don't have to copy the entire sample code ,just call this link to get channels. https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&hl=en&regionCode=US&key={YOUR KEY} You will get a json response with all the channels or videocategories available. Parse the response and you will get a "categoryId" from the response.

Then call this link to get the videolist for a particular categoryId https://www.googleapis.com/youtube/v3/videos?chart=mostPopular&part=snippet&type=video&videoCategoryId={a categoryId got from previous response }&maxResults=20&key={YOUR KEY}

parse the response.that's all.