ytb-js
v0.0.9
Published
A simplified way to retrieve data from the Youtube API.
Downloads
8
Maintainers
Readme
ytb-js
Installation
npm install ytb-js
About
This package is built on top of googleapis and is basically a simplified version of the youtube v3 api.
Quickstart
Importing the package
// javascript
const { Youtube } = require('ytb-js');
// typescript
import { Youtube } from 'ytb-js';
Using the package
const youtube = new Youtube("YOUR_API_KEY");
// This will return a JSON object that has data about the first 10 videos that the api found
ytb.search({ q: "Cat Videos", maxResults: 10 }).then((result) => {
console.log(result);
});
// This will return a JSON object that has data about the specified channel(s)
yt.searchChannels({ part: ["snippet"], forUsername: "jacksepticeye" }).then((result) => {
console.log(result);
});
// This will return a JSON object that has data about the comments of the specified video
yt.getVideoComments({ part: ["snippet"], videoId: "aV8bxGs3Wy4" }).then((result) => {
console.log(result);
});