youtubes.js
v0.6.0
Published
A JavaScript client for YouTube Data API v3.
Maintainers
Readme
[!WARNING] WIP
This project is in the early stages of development.
There may be many bugs remaining.Note:
youtubes.jsfollows semantic versioning (MAJOR.MINOR.PATCH). Between versions0.4.0and1.0.0,MINORversion updates may include breaking changes and non-backwards compatible features, whilePATCHupdates will only include backwards compatible changes and fixes.
Table of Contents
Highlights
- Full object-oriented architecture
- Complete TypeScript type definitions
- Robust error handling with
Resulttype - Built-in request pagination
Quick Start
npm i youtubes.js
yarn add youtubes.js
pnpm add youtubes.jsimport { 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();Supported endpoints
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
⚠️: Partially 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.
