youtubejs
v0.13.0
Published
A Javascript wrapper for the YouTube API v3. Also provides validation for request parameters, with helpful errors thrown.
Downloads
18
Readme
youtubejs
A Javascript wrapper for the YouTube API v3. Also provides validation for request parameters, with helpful errors thrown.
Usage
Initialization
Must specify an API Key
import YT from 'youtubejs';
YT.init({key: 'your-api-key'});
Fetching lists
import YT from 'youtubejs';
// Comments
YT.comments.list({part: 'snippet', id: 'comment-id'})
.then(comment => console.log(comment));
// Search
YT.search.list({part: 'snippet', q: 'search query'})
.then(searchResults => console.log(searchResults));
// Videos
YT.videos.list({id: 'POyIRViAgK8', part: 'snippet'})
.then(video => console.log(video));