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-v3-api

v1.1.1

Published

An Asynchronous promise based wrapper around the YouTube Data API.

Downloads

2,115

Readme

youtube-v3-api

An Asynchronous promise based wrapper around the YouTube Data API.

Build Status npm version DUB

Usage

Open terminal from the project folder execute the following command to install the package :

yarn add youtube-v3-api
--------OR--------
npm install youtube-v3-api 

Sample code snippet :

const { YoutubeDataAPI } = require("youtube-v3-api")
const API_KEY = '<ENTER YOUR API KEY HERE>';

const api = new YoutubeDataAPI(API_KEY);

api.searchAll(API_KEY,"Node Js",25).then((data) => {
    console.log(data);
},(err) => {
    console.error(err);
})

Documentation

searchAll

Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.

searchAll(q: string, maxResults: number, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • q : Search query.
  • maxResults : The maximum number of search results (0 - 50, for more results check out next and previous page call).
  • args (Optional) : Additional parameters, to know more click here.

searchVideo

Returns a list of videos that match the API request parameters.

searchVideo(id: string, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • id : Video Id.
  • args (Optional) : Additional parameters, to know more click here.

searchChannel

Returns a collection of zero or more channel resources that match the request criteria.

searchChannel(id: string, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • id : Channel Id.
  • args (Optional) : Additional parameters, to know more click here.

searchChannelSections

Returns a list of videos that match the API request parameters.

searchChannelSections(channelId: string, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • channelId : Channel Id.
  • args (Optional) : Additional parameters, to know more click here.

searchComments

Returns a list of comments that match the API request parameters.

searchComments(parentId: string, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • parentId : The parent comment is the first comment on a video.
  • args (Optional) : Additional parameters, to know more click here.

searchCommentThreads

Returns a list of comment threads that match the API request parameters.

searchCommentThreads(videoId: string, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • videoId : Video Id.
  • args (Optional) : Additional parameters, to know more click here.

searchPlaylist

Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs.

searchPlaylist(channelId: string, maxResults: number, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • channelId : Channel Id.
  • maxResults : The maximum number of search results (0 - 50, for more results check out next and previous page call).
  • args (Optional) : Additional parameters, to know more click here.

searchPlaylistItems

Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.

searchPlaylistItems(playlistId: string, maxResults: number, args?: any): Promise<{}>
  • API_KEY : The youtube API Key. See here to know about how to get an API KEY.
  • playlistId : Playlist Id.
  • maxResults : The maximum number of search results (0 - 50, for more results check out next and previous page call).
  • args (Optional) : Additional parameters, to know more click here.

Todo

  • Use the default Http module so that this module can be free from dependency.
  • Any missing basic API calls.
  • next and previous page.
  • Make typescript classes for the data returned so that additional functions can be attached like next page and previous page.
  • Embed all OAuth2 API's.
  • Add the additional API calls which need OAuth2 Access.

NOTE : Everything must Promised.