npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

youtube-api.js

v1.0.0

Published

A Node.js Package For Interacting With Youtube V3 API

Downloads

2

Readme

Installation

NPM

Api Menu

Getting API

Here is A Method to Get Youtube API Key in Steps: (Tutorial By RapidAPI)

  • The first step is to log in or create an account on https://developers.google.com/
  • When you log in into your account, follow this link https://console.developers.google.com/project and CREATE PROJECT by clicking on the blue button. Wait a few seconds for Google to prepare your project.
  • Fill in the name you want to assign to your project.
  • On the top left corner, click the Google APIs link and then follow the link option dubbed “YouTube DATA API” below the YouTube API’s icon.
  • Now select the “ENABLE” button which manifests after you click the YouTube DATA API link.
  • Now click the blue button on the far right with the “Go to Credentials” phrase.
  • On the first select option displayed on this page, choose the YouTube Data API v3, and then the Web server (such as node js. Tomcat) on the second option. For the third option, choose public data. Lastly, click the button with “what credentials do I need” and then move on to the next step.
  • After hitting the “What credentials do I need” button, Google will create your new project, and you can now copy your API Key from this page.
  • Now You Have The APi For this Package.

Youtube API

Youtube Search

The Basic Usage To Search for youtube video/channel is:

const Youtube = require('youtube-api.js');

const Client = new Youtube('api-key'); // replace api-key with your Youtube API

Client.search('Chess Tricks', 5, (res) => {
    // Searching 5 Results "Chess Tricks" on youtube
    console.log(res); // Video or Channel also included in the search
});

Youtube Video

The Basic Usage To Search for youtube video/channel is:

const Youtube = require('youtube-api.js'); // replace api-key with your Youtube API

const Client = new Youtube('api-key');

Client.getVideo('<videoid>', (res) => {
    console.log(res); 
    /**
    * How To get Video ID:
    * Heres an example of A Youtube Video Link
    * 
    * https://www.youtube.com/watch?<videoid>
    */
});

Youtube Channel

const Youtube = require('youtube-api.js'); // replace api-key with your Youtube API

const Client = new Youtube('api-key');

Client.getChannel('<channelid>', (res) => {
    console.log(res); 
    /**
    * How To get Channel ID:
    * Heres an example of A Youtube Channel Link
    * 
    * https://www.youtube.com/channel/<channelid>
    */
});