YouTube Search
Video Search
Search YouTube videos and consume normalized VideoResult objects.
js
const result = await searchYouTube("React tutorial", {
type: "video",
limit: 20,
});
for (const video of result.videos) {
console.log(video.id, video.title, video.duration);
}Video result fields
| Field | Description |
|---|---|
id | YouTube video identifier. |
title | Video title. |
thumbnail | Thumbnail URL and dimensions. |
author | Normalized channel/author information when available. |
viewCount | Numeric view count from the normalized search response. |
duration | Formatted duration. |
seconds | Duration converted to seconds. |
publishedAt | Published-time text extracted from YouTube. |
isLive | Whether the normalized result is marked as live. |