0

I want to search a list of Video and show it to screen with channel icons, but I don't know how to get channel_id or channel_icon direct link within the search query.

I'm following an example in youtube's developer page (Java), I want search result include channel_id or channel_icon, how to do?

search.setFields("items(id/videoId,snippet/title,snippet/thumbnails/default/url)");

[SOLVED]
I have solved my problem, I edited my fields filter, full code:

search = youtube.search().list("id,snippet");
search.setFields("items(id/videoId,snippet/title,snippet/thumbnails/default/url,snippet/channelId,snippet/channelTitle)");
// or just remove fields filter and then the response will constant all fileds for you

I got channelId and I can get channel icon, just replace the url with my channelId:

http://i.ytimg.com/i/[channelId]/1.jpg

Khang .NT
  • 1,504
  • 6
  • 24
  • 46
  • Checkout the thread [How can I get a channel ID from YouTube?](http://stackoverflow.com/questions/14366648/how-can-i-get-a-channel-id-from-youtube) . – blizzard Mar 23 '16 at 21:46

1 Answers1

1

How are you creating the search?

set "snippet" so that the api response includes channel id and other useful data:

YouTube.Search.List search = youtube.search().list("id,snippet");
Selçuk Cihan
  • 1,979
  • 2
  • 17
  • 30