Sunday, December 15, 2013

YouTube Data API v3: Accessing the description of a video using JavaScript

gapi.client.load('youtube', 'v3');
var request = gapi.client.youtube.videos.list({
  'part': 'snippet,contentDetails',
  'id'  : 'xZvADv7R46s'
  });

request.execute(function(resp) {
console.log(resp.items[0].snippet.description);
});


ScopeDescription
https://www.googleapis.com/auth/youtubeManage your YouTube account.
https://www.googleapis.com/auth/youtube.readonlyView your YouTube account.
https://www.googleapis.com/auth/youtube.uploadUpload YouTube videos and manage your YouTube videos.
https://www.googleapis.com/auth/youtubepartner-channel-auditRetrieve the auditDetails part in a channel resource.

No comments:

Post a Comment