I am only trying to fetch Youtube video's title. Can't seem to figure it. So far I have this:
q = 'https://www.googleapis.com/youtube/v3/videos?id='+ itemId +'&key='+ ytApiKey +'&fields=items(snippet(channelId,title,categoryId))&part=snippet' ;
$.ajax({
url: q,
dataType: "jsonp",
success: function(data){
alert(data.items[0].title);
console.log(data.snippet.title);
},
error: function(jqXHR, textStatus, errorThrown) {
alert (textStatus, + ' | ' + errorThrown);
}
});
Thanks,