# youtubei

> Simple package to get information from youtube such as videos, playlists, channels, video information & comments, related videos, up next video, and more!

Latest version **1.8.16** (published 2026-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install youtubei
pnpm add youtubei
yarn add youtubei
bun add youtubei
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.8.16 |
| Published | 2026-08-18 |
| First published | 2021-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 505.2 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 311 |
| Author | Vincent Jonathan |
| Maintainers | suspiciouslookingowl |
| Keywords | youtube, yt, search, video, videos, playlist, channel, related, comment, comments, live, chat, live chat |

## Links

- npm: https://www.npmjs.com/package/youtubei
- Repository: https://github.com/SuspiciousLookingOwl/youtubei
- Homepage: https://suspiciouslookingowl.github.io/youtubei
- Issues: https://github.com/SuspiciousLookingOwl/youtubei/issues
- npm.io page: https://npm.io/package/youtubei

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) 2.7.0
- [protobufjs](https://npm.io/package/protobufjs.md) 8.4.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.8.16 (latest) — 2026-08-18
- 1.8.15 — 2026-08-18
- 1.8.14 — 2026-08-16
- 1.8.13 — 2026-08-15
- 1.8.12 — 2026-08-14
- 1.8.11 — 2026-07-23
- 1.8.10 — 2026-06-01
- 1.8.9 — 2026-04-19
- 1.8.8 — 2026-04-19
- 1.8.7 — 2026-04-19
- 1.8.6 — 2026-04-19
- 1.8.5 — 2026-03-06
- 1.8.4 — 2026-01-28
- 1.8.3 — 2025-11-25
- 1.8.2 — 2025-11-25
- … 82 more at https://npm.io/package/youtubei/versions

## README

# Youtubei

`Youtubei` is made to replace my other library [scrape-yt](https://github.com/SuspiciousLookingOwl/scrape-yt/). Instead of scrapping data from Youtube page, `youtubei` fetches data by sending a request directly to `https://www.youtube.com/youtubei/v1`, which should be faster and provide more reliable result.

<b>Requires Node >= 16</b>

#### [Documentation](https://suspiciouslookingowl.github.io/youtubei)

## Installation

```
npm i youtubei
```

or use the dev build directly from GitHub:

```
npm i git://github.com/suspiciouslookingowl/youtubei.git#dist
```

## Example

```js
const { Client, MusicClient } = require("youtubei");
// or for TS / ES6
import { Client, MusicClient } from "youtubei";

const youtube = new Client();
const music = new MusicClient();

const run = async () => {
	const videos = await youtube.search("Never gonna give you up", {
		type: "video", // video | playlist | channel | all
	});

	console.log(videos.items.length); // 20
	const nextVideos = await videos.next(); // load next page
	console.log(nextVideos.length); // 18-20, inconsistent next videos count from youtube
	console.log(videos.items.length); // 38 - 40

	// you can also pass the video URL
	const video = await youtube.getVideo("dQw4w9WgXcQ");

	const channelVideos = await video.channel.videos.next();
	const channelPlaylists = await video.channel.playlists.next();

	// you can also pass the playlist URL
	const playlist = await youtube.getPlaylist("UUHnyfMqiRRG1u-2MsSQLbXA");
	console.log(playlist.videos.items.length); // first 100 videos;
	let newVideos = await playlist.videos.next(); // load next 100 videos
	console.log(playlist.videos.items.length); // 200 videos;
	await playlist.videos.next(0); // load the rest videos in the playlist

	// search using music client
	const shelves = await music.search("Never gonna give you up");
	console.log(shelves);
};

run();
```

---
_Source: https://npm.io/package/youtubei · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
