A JavaScript client for YouTube Data API v3.
Warning
WIP
This project is in the early stages of development.
There may be many bugs remaining.
Note: youtubes.js
follows semantic versioning (MAJOR.MINOR.PATCH). Between versions 0.4.0
and 1.0.0
, MINOR
version updates may include breaking changes and non-backwards compatible features, while PATCH
updates will only include backwards compatible changes and fixes.
- Full object-oriented architecture
- Complete TypeScript type definitions
- Robust error handling with
Result
type - Built-in request pagination
npm i youtubes.js
yarn add youtubes.js
pnpm add youtubes.js
import { ApiClient, StaticOAuthProvider } from "youtubes.js";
async function main() {
const oauth = new StaticOAuthProvider({
accessToken: "YOUR_ACCESS_TOKEN",
});
const client = new ApiClient({ oauth });
const playlistsPage = await client.playlists.getMine(); // Fetches the first page of playlists
const playlists = (await playlistsPage.all()).flat(); // Fetches all pages of playlists
}
main();
We are striving to support more endpoints, but currently, there are many unsupported endpoints. If the endpoint you want to use is not supported, please open an issue to request it. We plan to prioritize adding support for the most requested endpoints.
-: Not available in YouTube Data API
×: Not supported
✅: Fully supported
Endpoint | list (GET) | insert (POST) | update (PUT) | delete (DELETE) |
---|---|---|---|---|
Captions | × | × | × | × |
ChannelBanners | - | × | - | - |
Channels | × | - | × | - |
ChannelSections | × | × | × | × |
Comments | × | × | × | × |
CommentThreads | × | × | - | - |
I18nLanguages | × | - | - | - |
I18nRegions | × | - | - | - |
Members | × | - | - | - |
MembershipsLevels | × | - | - | - |
PlaylistImages | × | × | × | × |
PlaylistItems | ✅ | × | ✅ | |
Playlists | ✅ | ✅ | ✅ | ✅ |
Search | × | - | - | - |
Subscriptions | × | × | - | × |
Thumbnails | - | × | - | - |
VideoAbuseReportReasons | × | - | - | - |
VideoCategories | × | - | - | - |
Videos | × | × | × | × |
Watermarks | - | × | - | - |
We currently do not plan to support the YouTube Live Streaming API.