• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Youtube api implementation for nodeJS

youtube-node Dependency Status NPM version

NPM

  • YouTube API v3 - Require key (video)
  • CLI

CLI

For use CLI need install youtube-node using -g param.

$ npm install youtube-node -g

CLI Example getById ( require key and video ID )

$ youtube id

CLI Example search (require key, query and maxResults)

$ youtube search

Usage

Installation

$ npm install youtube-node

Example search (search term, num results, params, callback) return object

var YouTube = require('youtube-node');

var youTube = new YouTube();

youTube.setKey('AIzaSyB1OOSpTREs85WUMvIgJvLTZKye4BVsoFU');

youTube.search('World War z Trailer', 2, function(error, result) {
  if (error) {
    console.log(error);
  }
  else {
    console.log(JSON.stringify(result, null, 2));
  }
});

See output: https://gist.github.com/paulomcnally/620b76a9afe81f56e8c9

You can also pass in an optional params object. This is useful for paging:

youTube.search('World War z Trailer', 2, {pageToken: 'XxXxX'}, function(error, result) {
  //as above example
});

Page token is a property on the response - nextPageToken or previousPageToken

Example getById (youtube id, result) return object

var YouTube = require('youtube-node');

var youTube = new YouTube();
youTube.setKey('AIzaSyB1OOSpTREs85WUMvIgJvLTZKye4BVsoFU');

youTube.getById('HcwTxRuq-uk', function(error, result) {
  if (error) {
    console.log(error);
  }
  else {
    console.log(JSON.stringify(result, null, 2));
  }
});

See output: https://gist.github.com/paulomcnally/50e0b96291c82b87009b

Example related (youtube id, maxResults, result) return object

var YouTube = require('youtube-node');

var youTube = new YouTube();

youTube.setKey('AIzaSyB1OOSpTREs85WUMvIgJvLTZKye4BVsoFU');

youTube.related('hafhSaP_Nh4', 2, function(error, result) {
  if (error) {
    console.log(error);
  }
  else {
    console.log(JSON.stringify(result, null, 2));
  }
});

See output: https://gist.github.com/paulomcnally/ebab23c68c374723f28a

Optional Parameters

https://developers.google.com/youtube/v3/docs/search/list#optional-parameters

To set an optional parameter use:

youTube.addParam('order', 'title');

For older version use:

$ npm install [email protected]

Older version use API v2 and is not recommended

Those who use it?

More Repositories

1

node-heroku-ssl-redirect

Redirect users to the SSL version of your app. For ExpressJS running on Heroku
TypeScript
133
star
2

jt400.js

Implementation http://jt400.sourceforge.net/ on JavaScript
JavaScript
12
star
3

fb-id

Get page ID from facebook page url
JavaScript
11
star
4

loopback-example-multitenant

Loopback with PostgreSQL Multitenant
JavaScript
11
star
5

sms-manager

JavaScript
10
star
6

imdb-node

IMDB scraping API.
JavaScript
8
star
7

score-desktop

Score on real time to use on basketball leagues
JavaScript
4
star
8

grunt-loopback-auto

Grunt plugin for automigrate and autoupdate data sources for LoopBack
JavaScript
4
star
9

json-api-response

API responses in JSON format
JavaScript
3
star
10

nodejs-websocket-webserver

WebSocket receive via get params and websocket send the params to client
JavaScript
3
star
11

zsh_custom

Shell
2
star
12

loopback-dasherize

Dasherize models to load middleware files
JavaScript
2
star
13

node-tuc

TUC Client
JavaScript
2
star
14

firebase-storage-example

Java
2
star
15

android-resources

2
star
16

imdb

Scrapping www.imdb.com
JavaScript
1
star
17

pi-voice

Raspberry Pi Voice
Python
1
star
18

DatabaseMysqli-php

Improved version of the class implemented in php ezSQL MSQLI
PHP
1
star
19

dustjs-helpers-markdown

Helpers Markdown for dustjs-linkedin package
JavaScript
1
star
20

photobucket-ftp-php

Siple class to upload images to photobucket via FTP Pro Only
PHP
1
star
21

uca-cli

Interfaz de línea de comandos
JavaScript
1
star
22

payoneer-tax-ni

JavaScript
1
star
23

demo-xd

Java
1
star
24

phrases-android-christians

Java
1
star
25

trial-extend-solid-explorer-2

1
star
26

tuc-mpeso

JavaScript
1
star
27

techo-nicaragua-android

https://play.google.com/store/apps/details?id=com.techo.nicaragua
Java
1
star
28

imgur-wordpress-plugin

A simple imgur plugin
PHP
1
star
29

multi-tenant-base-example

Ruby
1
star
30

Android-Authentication

Autentication via post with api php
PHP
1
star
31

ineter.js

Web scraping INETER map of earthquakes
JavaScript
1
star
32

fundacion-zamora-teran-android

1
star
33

mc-pass

Generate an encrypted password for your accounts on the internet.
JavaScript
1
star
34

opencore-bigsur

1
star
35

google-jstemplate

Automatically exported from code.google.com/p/google-jstemplate
JavaScript
1
star
36

Hack-Fest-2014-inscription

Inscripción automática con datos aleatorios
JavaScript
1
star
37

iterm2-scripts

https://iterm2.com/python-api/tutorial/running.html
Python
1
star
38

web5250

JavaScript
1
star
39

node-musically-downloader

Downloader video server from musical.ly.
JavaScript
1
star
40

opencore-monterey

1
star
41

Camera.js

Picture to Web cam using Raspberry Pi + Modem 3G
JavaScript
1
star
42

node-app

React Native Android and iOS app for NodeJS
Objective-C
1
star
43

node-bac

Bac Nicaragua | Balance
JavaScript
1
star
44

uca-assist-control-android

Control de asistencia de clases de UCA
Java
1
star
45

react-native-checkbox-green

Checkbox green component for React native
JavaScript
1
star
46

iLinking

Web system for publishing and mobile text messaging in social networks.
PHP
1
star
47

node-project

JavaScript
1
star
48

UCA-270093-20171C

Desarrollo de Aplicaciones Móviles II
1
star
49

perrito-android

Kotlin
1
star
50

techo-nicaragua-facebook-app-ponete-en-movimiento

Tab para pagina de Fans en Facebook que muestra información acerca del Desafio 5K
JavaScript
1
star