youtube-search-for-discord-bots
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

youtube-search: Node.js

Search videos on youtube without API key

Table of contents:

Quickstart

Installing the library

npm install youtube-search-without-api-key --save

Using the library

import * as yt from 'youtube-search-without-api-key';

/**
 * Given a search query, searching on youtube
 * @param {string} search value (string or videoId).
 */
const videos = await yt.search('Hallo Welt');
const videos = await yt.search('y5kIrbG2gRc');
console.log('Videos:');
console.log(videos);

[{ kind: 'youtube#searchResult',
     channel:
      { id: 'UCFzpTuxdolZ_EaZr-emNgbg',
        name: 'David Koller',
        url: 'https://www.youtube.com/channel/UCFzpTuxdolZ_EaZr-emNgbg' },
     id:
      { videoId: 'y5kIrbG2gRc',
        channelId: 'UCFzpTuxdolZ_EaZr-emNgbg' },
     snippet:
      { url: 'https://www.youtube.com/watch?v=y5kIrbG2gRc',
        thumbnails: {
            "url":"https://i.ytimg.com/vi/y5kIrbG2gRc/hqdefault.jpg?sqp=-oaymwEjCPYBEIoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLA-pk9HLDSz4VelSFZ01ceyeIpBSw",
            "width":"246",
            "height":"138"
        },
        publishedAt: 'vor 3 Monaten',
        duration: '2:01',
        title: 'How to Download Free Music On Your iPhone (OFFLINE) 2020',
        views: '51',
        description:
         'This video will show you how to download free music and videos on your iphone easy and fast 2020 ...' } 
},...]
const yt = require('youtube-search-without-api-key');

/**
 * Given a search query, searching on youtube
 * @param {string} search value.
 */
const videos = await yt.search('My Search Query');
console.log('Videos:');
console.log(videos);

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js.

License

Apache Version 2.0

See LICENSE

Readme

Keywords

Package Sidebar

Install

npm i youtube-search-for-discord-bots

Weekly Downloads

0

Version

1.2.0

License

none

Unpacked Size

31 kB

Total Files

9

Last publish

Collaborators

  • schblondie