2.1.0 • Published 6 months ago

youtube-finder-sync v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

NPM

youtube-finder-sync

A client for connect YOUTUBE API with an application javascript. All promise-based.

Install

npm install youtube-finder-sync

yarn add youtube-finder-sync

pnpm add youtube-finder-sync

Usage

const YTClient = require('youtube-finder-sync');
const client = new YTClient({ key: 'YOUR_API_KEY' });

Search

const params = {
  part: 'snippet',
  q: 'Rick Roll',
  maxResults: 5,
};

client
  .search(params)
  .then(data => {
    // your code
  })
  .catch(err => {});

Mandatory parameters

part
    The part names that can be included in the parameter value are:
        - snippet
        - id

Filters and additional parameters

* maxResults
    Acceptable values are {0/} a 50, both inclusive. The default is 5.

* q
    The parameter q specifies the query term to be searched

* type
    The acceptable values are:
        * channel
        * playlist
        * video
    default value is: video,channel,playlist

* videoDuration
    Acceptable values are:
        * any: do not filter search results videos by duration. This is the default value.
        * long: Include only videos more than 20 minutes.
        * medium: Include only videos between 4 and 20 minutes (inclusive) in length.
        * short: Include only videos of less than 4 minutes.

more info at website official: https://developers.google.com/youtube/v3/docs/search/list#parmetros