ductran
ductran

Reputation: 10203

Get Youtube publish channel playlist videos in android

Possible duplicate this question but I can't find the answer for my problem.
I tried to read Youtube channel document, but I don't understand how to receive the channel information by its name, for example from BBC news .
And I tried to follow sample code in java to search video and I can get the videos list by search term.
I just wonder is there any way to get playlists (which contain video id) of special public channel by its name, then I can video in playlist by id? And do I need to know its id?

Upvotes: 1

Views: 3148

Answers (2)

Burak Durmuş
Burak Durmuş

Reputation: 987

You can try this request

"https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=" + channelId + "&pageToken=" +pageToken + "&key=YOUR_KEY"

Upvotes: 0

ductran
ductran

Reputation: 10203

Finally I can get it by using Http GET API from Google. Here is an example for someone need them:
First, I get the channel id by using channel API like this:

https://www.googleapis.com/youtube/v3/channels?part=id%2Csnippet&forUsername=bbcnews&key={YOUR_API_KEY}

Then I used Search API to get the videos and playlist of this channel by id:

https://www.googleapis.com/youtube/v3/search?part=id%2C+snippet&channelId=UC16niRr50-MSBwiO3YDb3RA&maxResults=50&order=date&type=video%2C+playlist&key={YOUR_API_KEY}

Here is the place where you can try Youtube API.

Upvotes: 4

Related Questions