https://github.com/brandonbothell/popyt
A very easy to use Youtube Data v3 API library.
https://github.com/brandonbothell/popyt
api-wrapper promise simple-api typescript video wrapper youtube youtube-api youtube-data youtube-data-api
Last synced: about 1 month ago
JSON representation
A very easy to use Youtube Data v3 API library.
- Host: GitHub
- URL: https://github.com/brandonbothell/popyt
- Owner: brandonbothell
- License: unlicense
- Created: 2018-08-05T13:52:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2026-04-25T09:23:30.000Z (about 1 month ago)
- Last Synced: 2026-04-25T09:25:06.342Z (about 1 month ago)
- Topics: api-wrapper, promise, simple-api, typescript, video, wrapper, youtube, youtube-api, youtube-data, youtube-data-api
- Language: TypeScript
- Homepage: https://popyt.brandonsbench.net/
- Size: 374 MB
- Stars: 45
- Watchers: 2
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Popyt
Want to access data from the YouTube Data v3 API? Want a Node.js YouTube API wrapper with typings, promises, and caching? No problem! We've got ya covered. `npm i popyt`
[](https://github.com/brandonbothell/popyt/stargazers)
[](https://bundlephobia.com/package/popyt)
[](https://github.com/brandonbothell/popyt/blob/master/LICENSE)
[](https://github.com/brandonbothell/popyt/issues)
[](https://github.com/brandonbothell/popyt/actions)
[](https://app.codecov.io/gh/brandonbothell/popyt/tree/release)
[](https://deepscan.io/dashboard#view=project&tid=21522&pid=24946&bid=772144)
[](https://www.npmjs.com/package/popyt)
[](https://www.npmjs.com/package/popyt)
[](https://bundlephobia.com/package/popyt)
[](https://github.com/brandonbothell/popyt/network/dependents)
[](https://ghloc.vercel.app/brandonbothell/popyt?branch=master&locsPath=%5B%22src%22%5D)
[](https://popyt.brandonsbench.net/docs/api/Library-Exports/classes/YouTube)
## Ask the AI assistant on the [documentation site](https://popyt.brandonsbench.net/docs/api), try out the [5-minute tutorial](https://popyt.brandonsbench.net/docs/tutorial/intro), or clone the [example project](https://github.com/brandonbothell/popyt-example).
### What you'll need
- A [YouTube Data v3](https://developers.google.com/youtube/v3/getting-started) API key:
- Complete steps 1-4 on the page linked above and copy your API key.
### Here are some basic methods ([try it on CodeSandbox](https://codesandbox.io/p/sandbox/fetch-videos-from-youtube-jmqlfq)):
Instantiate the object:
```js
const { YouTube } = require('popyt')
const youtube = new YouTube(apiKey)
```
Instantiate the object without caching:
```js
const { YouTube } = require('popyt')
const youtube = new YouTube(apiKey, undefined, { cache: false })
```
Get a video by ID:
```js
const video = await youtube.getVideo('dQw4w9WgXcQ')
console.log(video)
```
You can do the same thing with playlists, channels, and comments by replacing `Video` with any of them.
Get a video by URL:
```js
const video = await youtube.getVideo('https://youtube.com/watch?v=dQw4w9WgXcQ')
console.log(video)
```
Get a video by title (or similar title):
```js
const video = await youtube.getVideo('never gonna give you up')
console.log(video)
```
Search videos:
```js
const search = await youtube.searchVideos('never gonna give you up')
console.log(search.items.map(v => v.title).join('\n')) // titles of 50 beautiful videos
```
Note: This wrapper does not implement every feature of the YouTube API. If you would like anything added, feel free to open a PR or an issue. The limits imposed by the wrapper are not imposed by YouTube.