Socket
Socket
Sign inDemoInstall

node-youtube

Package Overview
Dependencies
52
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-youtube

[![node-youtube](https://img.shields.io/npm/v/node-youtube.svg?style=flat-square)](https://www.npmjs.com/package/node-youtube/)


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-youtube

node-youtube

Youtube class for API.

Install

$ npm i node-youtube -S

Tests

$ npm test

Methods

constructor(key)

ParameterTypeRequired
keystringyes
const Youtube = require('node-youtube')
const youtube = new Youtube(process.env.TOKEN)

.getChannel(settings)

ParameterTypeRequired
settingsobjectyes
settings.usernamestringyes (without channelId)
settings.channelIdstringyes (without username)
...settings...no

Returns channel data by username or channelId.

const channel = await youtube.getChannel({
  username: 'streetcap1',
  part: 'contentDetails'
})

// {
//   kind: 'youtube#channel',
//   etag: '"ld9biNPKjAjgjV7EZ4EKeEGrhao/aZiv9aPKFfsu2O4WeOfZMtZlbtk"',
//   id: 'UChMP5nRHcz0RxoMm0qRR2uw',
//   ...
// }

.getPlaylist(settings)

ParameterTypeRequired
settingsobjectyes
settings.channelIdstringyes (without playlistId)
settings.playlistIdstringyes (without channelId)
...settings...no

Returns playlist by channelId or playlistId.

const playlist = await youtube.getPlaylist({
  channelId: 'UC_x5XG1OV2P6uZZ5FSM9Ttw',
  maxResults: 50,
  part: [ 'snippet', 'contentDetails' ]
})

// {
//   kind: 'youtube#playlistListResponse',
//   etag: '"ld9biNPKjAjgjV7EZ4EKeEGrhao/uG7wIWKX43lrDZXh3F5bjaoNCb4"',
//   nextPageToken: 'CDIQAA',
//   pageInfo: { totalResults: 363, resultsPerPage: 50 },
//   items: [ ... ],
//   ...
// }

License

MIT.

Keywords

FAQs

Last updated on 05 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc