API Reference
getVideoDetails
Fetch and normalize full video details from YouTube by video ID.
ts
getVideoDetails(videoID: string): Promise<VideoDetailsResult>Parameters
| Name | Type | Description |
|---|---|---|
videoID | string | YouTube 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);