Guide
YouTube Search in Node.js
A practical path from installation to normalized YouTube search results.
1
Install
Run npm install ytsearch.js and choose ESM or CommonJS.
2
Search
Call searchYouTube with a query and options.
3
Read results
Consume videos, channels, playlists and metadata.
4
Paginate
Call nextPage() when another page is available.
js
import { searchYouTube } from "ytsearch.js";
const results = await searchYouTube("JavaScript tutorial", {
type: "video",
sort: "relevance",
limit: 20,
});
console.log(results.videos);
console.log(results.metadata);