Skip to content

iErcann/yt-get-info

Repository files navigation

yt-get-info

Get youtube video information

Uses the 'ytInitialPlayerResponse' client side variable.


Install

npm install yt-get-info

Usage

import { getVideoInfo } from "yt-get-info";

getVideoInfo("nSnLpFYLgDU").then(data => {
    // see VideoDetails object
    const { title, author, channelId, viewCount, keywords, shortDescription } = data.videoDetails;

    // See CaptionTracks object
    const captionsTrackList = data.captions.playerCaptionsTracklistRenderer;
    const { captionTracks, audioTracks } = captionsTrackList;

    // See PlayerMicroformatRenderer object
    const additionnalDetails = data.microformat.playerMicroformatRenderer;
    const { category, description, lengthSeconds, publishDate, ownerChannelName, thumbnail, isFamilySafe } = additionnalDetails;
}
);

API

getVideoInfo(videoId : string) : VideoInfo

About

Get youtube video information without an API key

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published