
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Youtube API v3 Universal Javascript Library for nodeJS, AMD and browser which provides easy API
Youtube API v3 Universal Javascript Library for nodeJS, AMD and browser which provides easy API
No Jquery needed.
Example
var youtube = require('ytjs')("API KEY");
youtube.getdata({ videoId: "TlgqWeuhJj4"},function(err, result){
if(err) {
console.log(err);
return false;
}
console.log(result);
});
include yt.js
<script type="text/javascript" src="yt.js" ></script>
Initalize the library and get Data
var youtube = $youtube("API KEY");
youtube.getdata({ videoId: "TlgqWeuhJj4" },function(err, result){
if(err) {
console.log(err);
return false;
}
console.log(result);
});
youtube.getdata({ videoId: "PMr2NRPdpH4"}, function(err, result){
if(err) {
console.log(err);
return false;
}
console.log(result);
});
Methods Available
youtube.getdata({ videoId: "TlgqWeuhJj4" },function(err, result){
if(err) {
console.log(err);
return false;
}
console.log(result);
});
youtube.search({keyword: "rihanna love", fullResults: 1, order: "relevance"}, function(err, data){
if(err) {
console.log(err);
return false;
}
console.log(data);
});
youtube.getComments({videoId: "PMr2NRPdpH4"}, function(err, data){
if(err) {
console.log(err);
return false;
}
console.log(data);
});
youtube.getRelatedVideos({videoId: "PMr2NRPdpH4"}, function(err, data){
if(err) {
console.log(err);
return false;
}
console.log(data);
});
You can get wide variety of data from getdata method and always youtube original data can be referred in raw
"title":
"description":
"rating":
"views":"",
"publishedAt":
"dthumbnail":
"mthumbnail":
"hthumbnail":
"sthumbnail":
"categoryId":
"channelTitle":
"videoId":"",
"duration":
"mins":
"hr":
"secs":
"dimension":
definition":
caption":
licensedContent":
"viewCount":
"likeCount":
"dislikeCount":
"favoriteCount":
"commentCount":
"kind":
"channelId":
"thumbnails":{}
"tags":{}
"liveBroadcastContent":"none"
"localized":{}
"projection":
"raw":{}
You can get wide variety of data from search method. Results of search will be returned in videos array and always youtube original data can be referred in raw
"videos" : []
nextPageToken:
prevPageToken:
kind:
youtube.getComments({videoId: "PMr2NRPdpH4"}, function(err, data){
if(err) {
console.log(err);
return false;
}
console.log(data);
nextComments();
});
// next set of comments
function nextComments() {
youtube.getComments({videoId: "PMr2NRPdpH4", navigate: "next"}, function(err, data){
if(err) {
console.log(err);
return false;
}
console.log(data);
});
}
You can get wide variety of data from getComments method. Results of comments will be returned in items array and always youtube original data can be referred in raw
items array item usually have different values such as textDisplay, authorDisplayName, authorProfileImageUrl, likeCount etc
items : []
nextPageToken:
prevPageToken:
resultsPerPage:
raw:
youtube.getRelatedVideos({videoId: "PMr2NRPdpH4"}, function(err, data){
if(err) {
console.log(err);
return false;
}
console.log(data);
});
You can get wide variety of data from getRelatedVideos method. Results of related videos will be returned in videos array and always youtube original data can be referred in raw
"videos" : []
nextPageToken:
prevPageToken:
kind:
Debug mode will print details to your console. you can enable debug mode during intialization by passing true
var youtube = $youtube("API KEY", true);
[ x ] get Video Data
[ x ] search for videos
[ x ] get Comments
[ x ] npm module
[ x ] related videos
[ ] Please open an issue
FAQs
Youtube API v3 Universal Javascript Library for nodeJS, AMD and browser which provides easy API
The npm package ytjs receives a total of 3 weekly downloads. As such, ytjs popularity was classified as not popular.
We found that ytjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.