ytsearch.js
API Reference

getVideoDetails

Fetch and normalize full video details from YouTube by video ID.

ts
getVideoDetails(videoID: string): Promise<VideoDetailsResult>

Parameters

NameTypeDescription
videoIDstringYouTube video ID.

Returns

Resolves to VideoDetailsResult.

Example

js
import { getVideoDetails } from "ytsearch.js";

const video = await getVideoDetails("dQw4w9WgXcQ");

console.log(video.title);
console.log(video.channel.name);
console.log(video.views);

Related errors