ytsearch.js
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

SectionPurpose
InstallationInstall the package and understand supported module systems.
SearchSearch YouTube and paginate result pages.
PlaylistsFetch playlist metadata and videos.
Video detailsFetch normalized video metadata by ID.
API referenceFunction-level signatures and behavior.
TypesExported TypeScript interfaces and unions.
ErrorsError class and error codes.