Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

ytb-js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytb-js

A simplified way to retrieve data from the Youtube API.

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
1
Created
Source

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);
});

Information about other methods/method options can be found in the GitHub Repository

Also this package currently does not have all the methods that googleapis has, but I will try my best to make them as soon as possible

Keywords

youtube

FAQs

Package last updated on 19 Mar 2023

Did you know?

Socket

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.

Install

Related posts