1.4.5 • Published 4 years ago
ytube-api v1.4.5
ytube-api
YouTube API v3 implementation for NodeJS
Requirement
API Key. To create API Key follow the steps https://cloud.google.com/docs/authentication/api-keys
Usage:
Installation
npm install ytube-api
Example
List category videos based on Region:
const youTube = new YouTube();
youTube.setKey('API_KEY');
youTube.getMostPopularByCategoryAndRegion(2, 10, 'AU', function(error, result) {
if (error) {
console.log(error);
} else {
console.log(JSON.stringify(result, null, 2));
}
});
Get Channel details by IDs
const youTube = new YouTube();
youTube.setKey('API_KEY');
const channelIds = [
"UC_x5XG1OV2P6uZZ5FSM9Ttw",
"UC29ju8bIPH5as8OGnQzwJyA"
]
youTube.getChannelById(channelIds, (err, response) => {
if (err) console.log(err);
console.log(JSON.stringify(response));
});
Get Video details by ID.
const youTube = new YouTube();
youTube.setKey('API_KEY');
const Ids = [
"---KhTqjC4M",
]
youTube.getById(Ids, (err, response) => {
if (err) console.log(err);
console.log(JSON.stringify(response));
});
To set an optional parameter use:
youTube.addParam('order', 'title');
Documentation
The official Youtube documentation is a very useful resource as a reference.
- getChannelById
- getPlayListsById
- getPlayListsItemsById
- search
- related
- getMostPopular
- getMostPopularByCategory
- getMostPopularByCategoryAndRegion
Help
- For bug reports and feature requests, open issues.
License
1.4.5
4 years ago
1.4.4
4 years ago
1.4.3
4 years ago
1.4.2
4 years ago
1.4.1
4 years ago
1.4.0
4 years ago
1.3.7
4 years ago
1.3.6
4 years ago
1.3.5
4 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago