Getting Started
Documentation
Everything you need to install ytsearch.js, search YouTube, fetch playlist items, retrieve video metadata and work with the exported TypeScript types.
What is ytsearch.js?
ytsearch.js is a Node.js and TypeScript library that normalizes public YouTube data into developer-friendly result objects. It supports video, channel, playlist, movie and live search, playlist pagination and detailed video metadata.
For API accuracy, this documentation follows the package's generated TypeScript declarations in v2.1.3. The declarations are treated as the source of truth where the README wording differs.
Documentation path
| Section | Purpose |
|---|---|
| Installation | Install the package and understand supported module systems. |
| Search | Search YouTube and paginate result pages. |
| Playlists | Fetch playlist metadata and videos. |
| Video details | Fetch normalized video metadata by ID. |
| API reference | Function-level signatures and behavior. |
| Types | Exported TypeScript interfaces and unions. |
| Errors | Error class and error codes. |