Socket
Socket
Sign inDemoInstall

youtube-search

Package Overview
Dependencies
4
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

youtube-search

Search for youtube videos


Version published
Maintainers
1
Weekly downloads
1,705
decreased by-48.92%
Bundle size
5.4 kB
Minified + gzipped

Weekly downloads

Readme

Source

build status JavaScript Style Guide

Easily search for videos on Youtube using their v3 API.

Options

You can pass a lot of optional parameters as the second parameter, they are documented here.

Rate limiting

Google enforces a rate limit on the Youtube Data API. You will probably need to register your application for a key and supply this key in the opts.

JavaScript Usage

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

var opts = {
  maxResults: 10,
  key: 'yourkey'
};

search('jsconf', opts, function(err, results) {
  if(err) return console.log(err);

  console.dir(results);
});

TypeScript Usage

A TypeScript definition file is included so that 'youtube-search' can be used easily from TypeScript.

import * as youtubeSearch from "youtube-search";

var opts: youtubeSearch.YouTubeSearchOptions = {
  maxResults: 10,
  key: "yourkey"
};

youtubeSearch("jsconf", opts, (err, results) => {
  if(err) return console.log(err);

  console.dir(results);
});

Tests

To run the tests you need a Youtube v3 API key:

API_KEY=<your-api-key> npm test

Keywords

FAQs

Last updated on 29 Jan 2021

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