npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ytsearch_api

v1.2.2

Published

유튜브 영상을 검색하고(5개씩), 영상의 정보를 가져오는 라이브러리 입니다.

Readme

Youtube Search API

유튜브 영상들을 검색, 정보를 얻어오는 라이브러리 입니다.

Youtube data api v3 기반으로 활성화된 구글 콘솔 API 키가 필요합니다.

사용법

const Youtube = require('ytsearch_api');

const key = "Y O U R  A P I  K E Y";

Youtube.SearchOnYoutube("A moment Apart", key).then(result => { // 영상만 검색(5개)
    console.log(result);
    
});

Youtube.SearchAllYoutube("오킹", key).then(result => { // 영상,채널 검색(5개)
    console.log(result);
});


ID값 또는 URL
Youtube.GetInfo("xarC5jAiO7w", key).then(result => {    // 영상 한개의 정보만
    console.log(result);
});

ID값 또는 URL
Youtube.GetListInfo("https://www.youtube.com/watch?v=xarC5jAiO7w&list=RDxarC5jAiO7w&start_radio=1", key).then(result => {   // Youtube 재생목록의 영상들 (최대 10개)
    console.log(result);
});

결과값

    SearchAllYoutube 리턴값
    {
        type: 'channel', // 결과값의 종류
        data: {
            id: 'UCom6YhUY62jM52nIMjf5_dw', // 채널 ID
            title: '오킹TV', // 채널 이름
            description: '...', // 채널 설명
            thumbnail: {    // 채널 프로필 이미지

                default: {
                    url: 'https://yt3.ggpht.com/-oH6-I9n6pBs/AAAAAAAAAAI/AAAAAAAAAAA/crQiKX0sCzg/s88-c-k-no-mo-rj-c0xffffff/photo.jpg'
                },
                medium: {
                    url: 'https://yt3.ggpht.com/-oH6-I9n6pBs/AAAAAAAAAAI/AAAAAAAAAAA/crQiKX0sCzg/s240-c-k-no-mo-rj-c0xffffff/photo.jpg'
                },
                high: {
                    url: 'https://yt3.ggpht.com/-oH6-I9n6pBs/AAAAAAAAAAI/AAAAAAAAAAA/crQiKX0sCzg/s800-c-k-no-mo-rj-c0xffffff/photo.jpg'
                }

            }
        }
    },
    {
        type: 'video',
        data: {
            id: 'xarC5jAiO7w', // 비디오 ID
            title: 'ODESZA - A Moment Apart', // 비디오 제목
            channel: 'ODESZA', // 업로더 채널이름
            description: '...', // 영상 설명
            duration: '3m55s',  // 영상 길이
            thumbnail: {    // 영상 썸네일
            
                default: {
                    url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/default.jpg',
                    width: 120,
                    height: 90
                },
                medium: {
                    url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/mqdefault.jpg',
                    width: 320,
                    height: 180
                },
                high: {
                    url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/hqdefault.jpg',
                    width: 480,
                    height: 360
                },
                standard: {
                    url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/sddefault.jpg',
                    width: 640,
                    height: 480
                },
                maxres: {
                    url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/maxresdefault.jpg',
                    width: 1280,
                    height: 720
                }

            }
        }
    }

    SearchOnYoutube 리턴값
    {
        id: 'xarC5jAiO7w', // 비디오 ID
        title: 'ODESZA - A Moment Apart', // 비디오 제목
        channel: 'ODESZA', // 업로더 채널이름
        description: '...', // 영상 설명
        duration: '3m55s',  // 영상 길이
        thumbnail: {    // 영상 썸네일
        
            default: {
                url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/default.jpg',
                width: 120,
                height: 90
            },
            medium: {
                url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/mqdefault.jpg',
                width: 320,
                height: 180
            },
            high: {
                url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/hqdefault.jpg',
                width: 480,
                height: 360
            },
            standard: {
                url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/sddefault.jpg',
                width: 640,
                height: 480
            },
            maxres: {
                url: 'https://i.ytimg.com/vi/5LgiiYaa96Q/maxresdefault.jpg',
                width: 1280,
                height: 720
            }

        }
    }

    모든 결과값은 배열에 담겨 리턴됩니다.

이외의 오류

    error: {
        message: 'The request is missing a valid API key.',
        domain: 'global',
        reason: 'forbidden'
    }

오류는 내부적으로 처리되지 않고 그대로 error 객체에 담겨 반환됩니다.

https://developers.google.com/youtube/v3/docs/errors