🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.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.

Source
npmnpm
Version
0.0.4-alpha
Version published
Maintainers
1
Created
Source

ytb-js

Installation

npm install ytb-js

Why would i use this instead of the googleapis package?

I found the googleapis package a little bit hard to use so this package does exactly the same thing as googleapis but its just much easier to use

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 big JSON object with some data about the request and 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 the same JSON object as the search method, but this time it will include data about the specified youtube channel
yt.searchChannels({ part: ["snippet"], forUsername: "jacksepticeye" }).then((result) => {
  console.log(result);
});

// This will return the same JSON object as before, but it will include data about the comments of the specified video
yt.getVideoComments({ part: ["snippet"], videoId: "aV8bxGs3Wy4" }).then((result) => {
  console.log(result);
});

You can see information about other methods in your code editor, including all of the options that you can include, and information about them too.

Keywords

youtube

FAQs

Package last updated on 11 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