Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yt-search

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yt-search

search youtube

  • 2.7.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
168K
decreased by-12.76%
Maintainers
1
Weekly downloads
 
Created

What is yt-search?

The yt-search npm package is a simple and efficient tool for searching YouTube videos, channels, and playlists. It provides an easy-to-use interface for fetching YouTube search results and metadata.

What are yt-search's main functionalities?

Search for Videos

This feature allows you to search for YouTube videos based on a query string. The code sample demonstrates how to search for videos related to 'Node.js tutorial' and log the results.

const ytSearch = require('yt-search');

async function searchVideos(query) {
  const result = await ytSearch(query);
  return result.videos;
}

searchVideos('Node.js tutorial').then(videos => {
  console.log(videos);
});

Search for Channels

This feature allows you to search for YouTube channels based on a query string. The code sample demonstrates how to search for channels related to 'Tech channels' and log the results.

const ytSearch = require('yt-search');

async function searchChannels(query) {
  const result = await ytSearch(query);
  return result.channels;
}

searchChannels('Tech channels').then(channels => {
  console.log(channels);
});

Search for Playlists

This feature allows you to search for YouTube playlists based on a query string. The code sample demonstrates how to search for playlists related to 'Music playlists' and log the results.

const ytSearch = require('yt-search');

async function searchPlaylists(query) {
  const result = await ytSearch(query);
  return result.playlists;
}

searchPlaylists('Music playlists').then(playlists => {
  console.log(playlists);
});

Get Video Details

This feature allows you to get detailed information about a specific YouTube video using its video ID. The code sample demonstrates how to fetch and log details for the video with ID 'dQw4w9WgXcQ'.

const ytSearch = require('yt-search');

async function getVideoDetails(videoId) {
  const result = await ytSearch({ videoId });
  return result;
}

getVideoDetails('dQw4w9WgXcQ').then(video => {
  console.log(video);
});

Other packages similar to yt-search

FAQs

Package last updated on 01 Apr 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc