Search YouTube and fetch videos, channels, and playlists through the unofficial InnerTube API, with optional cookie sessions and client identities.
ytube is an unofficial YouTube InnerTube client for JavaScript and TypeScript. It talks to the same internal endpoints YouTube's own clients use, behind a small namespaced API.
YouTube's official Data API is quota-limited and doesn't expose everything the apps can see. ytube gives you search, video and channel details, playlists, continuations, comments and more through one typed interface.
InnerTube is undocumented and can change without notice, so endpoints and response shapes may break. Some namespaces (music, Studio, live chat, notifications, comments) are early explorations.
bun add ytubeimport YouTube from "ytube";
const youtube = new YouTube();
const results = await youtube.search.videos("Tyler, The Creator");
console.log(results.items);
const video = await youtube.videos.get("VIDEO_ID");
console.log(video.title, video.author);
const channel = await youtube.channels.get("CHANNEL_ID");
const playlist = await youtube.playlists.get("PLAYLIST_ID");not affiliated with Google or YouTube.
released under the AGPL-3.0 License.