npm.io
0.2.0 • Published 10 years ago

youtube-sdk

Licence
MIT
Version
0.2.0
Deps
3
Vulns
5
Weekly
0
Stars
7

node youtube-sdk

Small SDK for youtube API.

Build Version Downloads License

Installation

npm install youtube-sdk

Example

// Setup

var Youtube = require('youtube-sdk');

var YT = new Youtube();
YT.use('Your key API')


var params = {
  part       : 'snippet',
  location   : '48.858319942162794,2.2944259643554683',
  locationRadius: '4000m',
  maxResults    : '50',
  order: 'date',
  type: 'video',
  publishedBefore: '2016-08-03T00:00:00Z', //Date Google
  publishedAfter: '2016-08-02T00:00:00Z'
};

// Request server API method

YT.get('search', params, function (err, data) {
  if (err){
    console.log(err);
  }else{
    console.log(data);
  }

});

Setup

var youtube = require('youtube-sdk');

var YT = new youtube();

YT.use('YOUR API KEY')

Required config options:

API requests

For youtube API requests you have to use method get(_resource, _params, _callback).

  • [string] _resource - name of youtube API resource,
    • 'activities'
    • 'channels'
    • 'channelBanners'
    • 'guideCategories'
    • 'playlistItems'
    • 'playlists'
    • 'search'
    • 'subscriptions'
    • 'thumbnails'
    • 'videoCategories'
    • 'videos'
  • [mixed] _params - object with values of parts for api method. This param is required.
    • 'snippet'
    • 'contentDetails'
    • 'status'
    • 'statistics'
    • 'player'
    • 'topicDetails'
    • 'recordingDetails'
    • 'fileDetails'
    • 'processingDetails'
    • 'suggestions'
    • '...'
  • [mixed] _callback - required, function callback.

For developers

Your commits and pull requests are welcome. Please run the tests before

npm test

You have to provide tests for the new features.

Support

Thanks to

Keywords