### Music Client Constructor Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Initializes a new instance of the Music client. ```APIDOC ## new Music() ### Description Initializes a new instance of the Music client. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "session": "" } ``` ### Response #### Success Response (200) - **Music** (`Music`) - An instance of the Music client. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Get Explore Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves content for the explore page. ```APIDOC ## GET /music/explore ### Description Retrieves content for the explore page. ### Method GET ### Endpoint `/music/explore` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **Explore** (`Explore`) - An object containing explore page content. #### Response Example ```json { "explore": "" } ``` ``` -------------------------------- ### Initialize and Use ProductList Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/ProductList Demonstrates how to instantiate the ProductList class and utilize its inherited type-checking and casting methods. ```typescript import { ProductList } from "./src/parser/classes/ProductList"; // Instantiate ProductList with raw data const productList = new ProductList(data); // Access contents property const items = productList.contents; // Use inherited type checking methods if (productList.is(ProductList)) { console.log("Node is a ProductList"); } // Use key assertion const keyExists = productList.hasKey("contents"); ``` -------------------------------- ### Get Watch Later Data (TypeScript) Source: https://ytjs.dev/api/youtubei.js/namespaces/YT/classes/Library Retrieves data related to the 'watch later' playlist. The return type is an object containing contents, a method to get all items, title, and type, or undefined if not available. ```typescript get watch_later(): { contents: any[]; getAll: () => Promise | History | Playlist>; title: Text; type: string | undefined; } | undefined ``` -------------------------------- ### GET /comments/continuation Source: https://ytjs.dev/api/youtubei.js/namespaces/YT/classes/Comments Retrieves the next batch of comments for pagination. ```APIDOC ## GET /comments/continuation ### Description Fetches the next page of comments if a continuation token is available. ### Method GET ### Response #### Success Response (200) - **contents** (Array) - The next batch of CommentThread objects. #### Response Example { "contents": [...], "has_continuation": true } ``` -------------------------------- ### Instantiate ProductListHeader Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/ProductListHeader Demonstrates how to initialize a new ProductListHeader instance using raw node data from the YouTube API. ```typescript import { ProductListHeader } from "./src/parser/classes/ProductListHeader"; const rawData = { /* raw node data from API */ }; const header = new ProductListHeader(rawData); console.log(header.title); ``` -------------------------------- ### Get Recap Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves the user's music recap. ```APIDOC ## GET /music/recap ### Description Retrieves the user's music recap. ### Method GET ### Endpoint `/music/recap` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **Recap** (`Recap`) - An object containing recap details. #### Response Example ```json { "recap": "" } ``` ``` -------------------------------- ### Instantiate GuideSection Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/GuideSection Demonstrates how to initialize a new GuideSection object using raw data. ```typescript import { GuideSection } from "src/parser/classes/GuideSection"; const rawData = { /* Raw node data from YouTube API */ }; const guideSection = new GuideSection(rawData); ``` -------------------------------- ### Instantiate CompactMovie Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/CompactMovie Demonstrates how to initialize a new CompactMovie instance using raw node data from the YouTube API. ```typescript import { CompactMovie } from "./src/parser/classes/CompactMovie"; const rawData = { /* Raw API node data */ }; const movie = new CompactMovie(rawData); ``` -------------------------------- ### Get Lyrics Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves the lyrics for a given video ID. ```APIDOC ## GET /music/lyrics/{video_id} ### Description Retrieves the lyrics for a given video ID. ### Method GET ### Endpoint `/music/lyrics/{video_id}` ### Parameters #### Path Parameters - **video_id** (string) - Required - The ID of the video to get lyrics for. #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **MusicDescriptionShelf** | **undefined** (`MusicDescriptionShelf` | `undefined`) - An object containing lyrics or undefined if not found. #### Response Example ```json { "lyrics": "" } ``` ``` -------------------------------- ### Instantiating GridVideo Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/GridVideo Demonstrates how to instantiate the GridVideo class using raw node data from the YouTube API parser. ```typescript import { GridVideo } from "./src/parser/classes/GridVideo"; const rawData = { /* RawNode data from API */ }; const gridVideo = new GridVideo(rawData); console.log(gridVideo.video_id); console.log(gridVideo.title.text); ``` -------------------------------- ### Get Library Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves the user's music library. ```APIDOC ## GET /music/library ### Description Retrieves the user's music library. ### Method GET ### Endpoint `/music/library` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **Library** (`Library`) - An object containing library details. #### Response Example ```json { "library": "" } ``` ``` -------------------------------- ### Get Home Feed Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves content for the home feed. ```APIDOC ## GET /music/homefeed ### Description Retrieves content for the home feed. ### Method GET ### Endpoint `/music/homefeed` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **HomeFeed** (`HomeFeed`) - An object containing home feed content. #### Response Example ```json { "homeFeed": "" } ``` ``` -------------------------------- ### Instantiate AutomixPreviewVideo Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/AutomixPreviewVideo Demonstrates how to initialize the AutomixPreviewVideo class using raw data from the YouTube API parser. ```typescript import { AutomixPreviewVideo } from "./src/parser/classes/AutomixPreviewVideo"; const rawData = { /* Raw node data from API */ }; const automixVideo = new AutomixPreviewVideo(rawData); ``` -------------------------------- ### Instantiate and Use ContinuationCommand Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/ContinuationCommand Demonstrates how to initialize the ContinuationCommand class with raw node data and utilize its core methods to build requests and retrieve API paths. ```typescript import { ContinuationCommand } from "./parser/classes/commands/ContinuationCommand"; // Initialize with raw node data const command = new ContinuationCommand(data); // Build the request object const request = command.buildRequest(); // Get the API path for the continuation const path = command.getApiPath(); // Type checking example if (command.is(ContinuationCommand)) { console.log("Node is a ContinuationCommand"); } ``` -------------------------------- ### GET /getInfo Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Kids Retrieves detailed information about a specific video. ```APIDOC ## GET /getInfo ### Description Retrieves metadata and info for a specific video. ### Method GET ### Parameters #### Query Parameters - **video_id** (string) - Required - The ID of the video. - **options** (Object) - Optional - Additional configuration options. ### Response #### Success Response (200) - **videoInfo** (VideoInfo) - The video information object. ``` -------------------------------- ### Initialize PlayerOverlayVideoDetails Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/PlayerOverlayVideoDetails Demonstrates how to instantiate the PlayerOverlayVideoDetails class using raw node data. ```typescript import { PlayerOverlayVideoDetails } from "./src/parser/classes/PlayerOverlayVideoDetails"; const rawData = { /* RawNode data */ }; const videoDetails = new PlayerOverlayVideoDetails(rawData); console.log(videoDetails.title); console.log(videoDetails.subtitle); ``` -------------------------------- ### Get Videos from Memo Source: https://ytjs.dev/api/youtubei.js/namespaces/YT/classes/Playlist.html Retrieves all videos from a given memo object. ```APIDOC ## POST /memo/videos ### Description Get all videos on a given page via memo. ### Method POST ### Endpoint `/memo/videos` ### Parameters #### Request Body - **memo** (Memo) - Required - The memo object containing video data. ### Request Example ```json { "memo": { "videos": [ { "title": "Example Video 1", "videoId": "dQw4w9WgXcQ" } ] } } ``` ### Response #### Success Response (200) - **videos** (ObservedArray) - An array of video objects. #### Response Example ```json { "videos": [ { "title": "Example Video 1", "videoId": "dQw4w9WgXcQ" } ] } ``` ``` -------------------------------- ### Initialize MusicCardShelf Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/MusicCardShelf Demonstrates how to instantiate a new MusicCardShelf object using raw data from the YouTube API. This constructor is typically used internally by the parser. ```typescript import { MusicCardShelf } from "src/parser/classes/MusicCardShelf"; const rawData = { /* Raw API response node */ }; const musicShelf = new MusicCardShelf(rawData); ``` -------------------------------- ### Get Playlists from Memo Source: https://ytjs.dev/api/youtubei.js/namespaces/YT/classes/Playlist.html Retrieves all playlists from a given memo object. ```APIDOC ## POST /memo/playlists ### Description Get all playlists on a given page via memo. ### Method POST ### Endpoint `/memo/playlists` ### Parameters #### Request Body - **memo** (Memo) - Required - The memo object containing playlist data. ### Request Example ```json { "memo": { "playlists": [ { "title": "Example Playlist 1", "playlistId": "PL1" } ] } } ``` ### Response #### Success Response (200) - **playlists** (ObservedArray) - An array of playlist objects. #### Response Example ```json { "playlists": [ { "title": "Example Playlist 1", "playlistId": "PL1" } ] } ``` ``` -------------------------------- ### Instantiate ThumbnailOverlayBottomPanel Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/ThumbnailOverlayBottomPanel Demonstrates how to initialize the ThumbnailOverlayBottomPanel class by passing raw data to the constructor. ```typescript import { ThumbnailOverlayBottomPanel } from "./src/parser/classes/ThumbnailOverlayBottomPanel"; const rawData = { /* Raw node data from YouTube API */ }; const panel = new ThumbnailOverlayBottomPanel(rawData); ``` -------------------------------- ### GET /parser/getParserByName Source: https://ytjs.dev/api/youtubei.js/namespaces/Parser/functions/getParserByName Retrieves a specific YTNodeConstructor by its class name string. ```APIDOC ## getParserByName(classname) ### Description Retrieves the constructor for a specific YouTube node by its class name. This is used internally by the parser to map response data to specific node classes. ### Method FUNCTION ### Endpoint src/parser/parser.ts:202 ### Parameters #### Path Parameters - **classname** (string) - Required - The name of the class to retrieve the constructor for. ### Returns - **YTNodeConstructor** (Object) - The constructor for the requested YTNode. ### Request Example getParserByName("VideoDetails") ### Response #### Success Response - **YTNodeConstructor** (Object) - The constructor function for the specified node class. #### Response Example { "constructor": "[Function: VideoDetails]" } ``` -------------------------------- ### Initialize MusicMenuItemDivider Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/MusicMenuItemDivider Demonstrates how to instantiate the MusicMenuItemDivider class. It requires raw node data as an input parameter. ```typescript import { MusicMenuItemDivider } from "./src/parser/classes/menus/MusicMenuItemDivider"; const divider = new MusicMenuItemDivider({ /* RawNode data */ }); ``` -------------------------------- ### Get Related Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves related content for a given video ID. ```APIDOC ## GET /music/related/{video_id} ### Description Retrieves related content for a given video ID. ### Method GET ### Endpoint `/music/related/{video_id}` ### Parameters #### Path Parameters - **video_id** (string) - Required - The ID of the video to find related content for. #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **SectionList** | **Message** (`SectionList` | `Message`) - An object containing related content. #### Response Example ```json { "relatedContent": "" } ``` ``` -------------------------------- ### Instantiate CompositeVideoPrimaryInfo Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/CompositeVideoPrimaryInfo Demonstrates how to create a new instance of the CompositeVideoPrimaryInfo class by passing raw node data to the constructor. ```typescript import { CompositeVideoPrimaryInfo } from "./src/parser/classes/CompositeVideoPrimaryInfo"; const rawData = { /* Raw node data */ }; const info = new CompositeVideoPrimaryInfo(rawData); ``` -------------------------------- ### Get Playlist Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves playlist information using the playlist ID. ```APIDOC ## GET /music/playlist/{playlist_id} ### Description Retrieves playlist information using the playlist ID. ### Method GET ### Endpoint `/music/playlist/{playlist_id}` ### Parameters #### Path Parameters - **playlist_id** (string) - Required - The ID of the playlist to retrieve. #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **Playlist** (`Playlist`) - An object containing playlist details. #### Response Example ```json { "playlist": "" } ``` ``` -------------------------------- ### Get Artist Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves artist information using the artist ID. ```APIDOC ## GET /music/artist/{artist_id} ### Description Retrieves artist information using the artist ID. ### Method GET ### Endpoint `/music/artist/{artist_id}` ### Parameters #### Path Parameters - **artist_id** (string) - Required - The ID of the artist to retrieve. #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **Artist** (`Artist`) - An object containing artist details. #### Response Example ```json { "artist": "" } ``` ``` -------------------------------- ### Instantiate and Interact with KidsHomeScreen Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/KidsHomeScreen Demonstrates how to initialize the KidsHomeScreen class and utilize its inherited type-checking and casting methods to safely access node data. ```typescript import { KidsHomeScreen } from "./src/parser/classes/ytkids/KidsHomeScreen"; // Initialize with raw node data const homeScreen = new KidsHomeScreen(data); // Accessing anchors property console.log(homeScreen.anchors); // Using inherited type checking if (homeScreen.is(KidsHomeScreen)) { console.log("This is a KidsHomeScreen instance"); } // Using key assertion const keyExists = homeScreen.hasKey("anchors"); ``` -------------------------------- ### Get Album Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves album information using the album ID. ```APIDOC ## GET /music/album/{album_id} ### Description Retrieves album information using the album ID. ### Method GET ### Endpoint `/music/album/{album_id}` ### Parameters #### Path Parameters - **album_id** (string) - Required - The ID of the album to retrieve. #### Query Parameters None #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **Album** (`Album`) - An object containing album details. #### Response Example ```json { "album": "" } ``` ``` -------------------------------- ### Artist Class Constructor Source: https://ytjs.dev/api/youtubei.js/namespaces/YTMusic/classes/Artist Initializes a new Artist object with the provided response and actions. ```APIDOC ## new Artist(response, actions) ### Description Initializes a new Artist object. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "response": "ApiResponse", "actions": "Actions" } ``` ### Response #### Success Response (200) Returns an instance of the Artist class. #### Response Example ```json { "artistInstance": "Artist" } ``` ``` -------------------------------- ### GET /getTranscript Source: https://ytjs.dev/api/youtubei.js/namespaces/YTShorts/classes/ShortFormVideoInfo Retrieves the transcript information for the current video. ```APIDOC ## GET /getTranscript ### Description Retrieves the video's transcript data. ### Method GET ### Endpoint /getTranscript ### Response #### Success Response (200) - **transcript** (TranscriptInfo) - The transcript object. ### Response Example { "transcript": { "segments": [...] } } ``` -------------------------------- ### Instantiate BackstagePostThread Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/BackstagePostThread Demonstrates how to initialize a new instance of the BackstagePostThread class by passing raw node data. ```typescript import { BackstagePostThread } from "./src/parser/classes/BackstagePostThread"; const rawData = { /* Raw node data from API */ }; const postThread = new BackstagePostThread(rawData); ``` -------------------------------- ### GET /getVideosFromMemo Source: https://ytjs.dev/api/youtubei.js/namespaces/YTKids/classes/HomeFeed Extracts all video objects from a provided page memo object. ```APIDOC ## GET /getVideosFromMemo ### Description Get all videos on a given page via memo. ### Method GET ### Endpoint /getVideosFromMemo ### Parameters #### Query Parameters - **memo** (Memo) - Required - The memo object to parse for videos. ### Response #### Success Response (200) - **videos** (Array) - List of video objects including CompactVideo, GridVideo, and others. ### Response Example { "videos": [] } ``` -------------------------------- ### Instantiating and Using TextHeader Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/TextHeader Demonstrates how to instantiate the TextHeader class and utilize its inherited methods for type checking and property access. ```typescript import { TextHeader } from "./src/parser/classes/TextHeader"; // Instantiate with raw data const header = new TextHeader(data); // Access properties console.log(header.style); console.log(header.title); // Use inherited type checking methods if (header.is(TextHeader)) { console.log("This is a TextHeader instance"); } // Use key assertion if (header.hasKey("title")) { const title = header.key("title"); } ``` -------------------------------- ### Instantiate MultiMarkersPlayerBar Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/MultiMarkersPlayerBar Demonstrates how to create a new instance of the MultiMarkersPlayerBar class using raw node data. ```typescript import { MultiMarkersPlayerBar } from "src/parser/classes/MultiMarkersPlayerBar"; const data = { /* RawNode data */ }; const playerBar = new MultiMarkersPlayerBar(data); ``` -------------------------------- ### GET /getPlaylistsFromMemo Source: https://ytjs.dev/api/youtubei.js/namespaces/YTKids/classes/HomeFeed Extracts all playlist objects from a provided page memo object. ```APIDOC ## GET /getPlaylistsFromMemo ### Description Get all playlists on a given page via memo. ### Method GET ### Endpoint /getPlaylistsFromMemo ### Parameters #### Query Parameters - **memo** (Memo) - Required - The memo object to parse for playlists. ### Response #### Success Response (200) - **playlists** (Array) - List of GridPlaylist, LockupView, or Playlist objects. ### Response Example { "playlists": [] } ``` -------------------------------- ### Initialize PlaylistPanelVideoWrapper Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/PlaylistPanelVideoWrapper Demonstrates the instantiation of the PlaylistPanelVideoWrapper class using raw data from the YouTube API. ```typescript import { PlaylistPanelVideoWrapper } from "src/parser/classes/PlaylistPanelVideoWrapper"; const rawData = { /* Raw API response data */ }; const videoWrapper = new PlaylistPanelVideoWrapper(rawData); ``` -------------------------------- ### GET /TabbedFeed/contents Source: https://ytjs.dev/api/youtubei.js/namespaces/Mixins/classes/TabbedFeed Retrieves the primary contents of the feed, such as videos, channels, or posts. ```APIDOC ## GET /TabbedFeed/contents ### Description Accesses the main content items of the feed, including categorized lists of videos, channels, and community posts. ### Method GET ### Endpoint /TabbedFeed/contents ### Response #### Success Response (200) - **videos** (ObservedArray) - List of video objects. - **channels** (ObservedArray) - List of channel objects. - **posts** (ObservedArray) - List of community posts. #### Response Example { "videos": [...], "channels": [...], "posts": [...] } ``` -------------------------------- ### Session Constructor Source: https://ytjs.dev/api/classes/Session Initializes a new Session instance. This constructor sets up the necessary context and configuration for interacting with YouTube's API. ```APIDOC ## Constructor Session ### Description Initializes a new Session instance. This constructor sets up the necessary context and configuration for interacting with YouTube's API. ### Method `new Session(context, api_key, api_version, account_index, config_data?, player?, cookie?, fetch?, cache?, po_token?)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **context** (`Context`) - Required - The context for the session. * **api_key** (`string`) - Required - The API key for authentication. * **api_version** (`string`) - Required - The API version to use. * **account_index** (`number`) - Required - The index of the account. * **config_data?** (`string`) - Optional - Configuration data for the session. * **player?** (`Player`) - Optional - The player instance. * **cookie?** (`string`) - Optional - Cookies for the session. * **fetch?** ({(`input`, `init?`): `Promise`<`Response`>; (`input`, `init?`): `Promise`<`Response`>; }) - Optional - A custom fetch implementation. * **cache?** (`ICache`) - Optional - A cache implementation. * **po_token?** (`string`) - Optional - The PO token for the session. ### Request Example ```json { "context": "some_context_object", "api_key": "YOUR_API_KEY", "api_version": "2.0", "account_index": 0 } ``` ### Response #### Success Response (200) * **Session** (`Session`) - The newly created Session instance. #### Response Example ```json { "session_instance": "" } ``` ``` -------------------------------- ### Get Search Suggestions Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves search suggestions based on user input. ```APIDOC ## GET /music/search/suggestions ### Description Retrieves search suggestions based on user input. ### Method GET ### Endpoint `/music/search/suggestions` ### Parameters #### Path Parameters None #### Query Parameters - **input** (string) - Required - The user's search input. #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **ObservedArray** (`ObservedArray`) - An array of search suggestions. #### Response Example ```json { "suggestions": [ "", "" ] } ``` ``` -------------------------------- ### GET /search Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Kids Performs a search query within the YouTube Kids environment. ```APIDOC ## GET /search ### Description Searches for content on YouTube Kids. ### Method GET ### Parameters #### Query Parameters - **query** (string) - Required - The search term. ### Response #### Success Response (200) - **results** (Search) - The search results object. ``` -------------------------------- ### GuideSubscriptionsSection Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/GuideSubscriptionsSection Details about the GuideSubscriptionsSection class, its inheritance, constructor, properties, and methods. ```APIDOC ## Class: GuideSubscriptionsSection Defined in: src/parser/classes/GuideSubscriptionsSection.ts:3 ### Description Represents a section in the YouTube guide that displays subscriptions. ### Extends * `GuideSection` ### Constructors #### new GuideSubscriptionsSection(data: RawNode): GuideSubscriptionsSection **Description**: Initializes a new instance of the GuideSubscriptionsSection class. **Parameters**: * `data` (RawNode) - The raw node data to initialize the section with. **Returns**: * `GuideSubscriptionsSection` - A new instance of GuideSubscriptionsSection. **Inherited from**: `GuideSection`.`constructor` ### Properties #### items : ObservedArray **Description**: An observed array of YTNode items within the subscriptions section. **Inherited from**: `GuideSection`.`items` #### title? : Text **Description**: An optional title for the subscriptions section. **Inherited from**: `GuideSection`.`title` #### type : string **Description**: The type of the section. **Inherited from**: `GuideSection`.`type` #### static type : string = 'GuideSubscriptionsSection' **Description**: Static property indicating the type of this class. **Overrides**: `GuideSection`.`type` ### Methods #### as(...types: K): InstanceType **Description**: Casts the current node to one of the specified types. **Type Parameters**: * `T` - A subclass of `YTNode`. * `K` - An array of `YTNodeConstructor` extending `T`. **Parameters**: * `...types` (K) - The types to cast to. **Returns**: * `InstanceType` - The node cast to one of the given types. **Throws**: * If the node is not of the given type. **Inherited from**: `GuideSection`.`as` #### hasKey(key: T): this is GuideSubscriptionsSection & { [k in string]: R } **Description**: Checks if the node has a specific key without asserting the type. **Type Parameters**: * `T` - A string representing the key. * `R` - The type of the value associated with the key (defaults to `any`). **Parameters**: * `key` (T) - The key to check. **Returns**: * `this is GuideSubscriptionsSection & { [k in string]: R }` - True if the node has the key, false otherwise. **Inherited from**: `GuideSection`.`hasKey` #### is(...types: K): this is InstanceType **Description**: Checks if the node is an instance of any of the specified types. **Type Parameters**: * `T` - A subclass of `YTNode`. * `K` - An array of `YTNodeConstructor` extending `T`. **Parameters**: * `...types` (K) - The types to check against. **Returns**: * `this is InstanceType` - True if the node is an instance of any of the specified types, false otherwise. **Inherited from**: `GuideSection`.`is` #### key(key: T): Maybe **Description**: Asserts that the node has the given key and returns its value. **Type Parameters**: * `T` - A string representing the key. * `R` - The type of the value associated with the key (defaults to `any`). **Parameters**: * `key` (T) - The key to retrieve. **Returns**: * `Maybe` - The value of the key wrapped in a Maybe, or Nothing if the key does not exist. **Throws**: * If the node does not have the key. **Inherited from**: `GuideSection`.`key` ``` -------------------------------- ### Initialize AboutChannelView Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/AboutChannelView Demonstrates how to instantiate the AboutChannelView class by passing the raw node data received from the YouTube API parser. ```typescript import { AboutChannelView } from "src/parser/classes/AboutChannelView"; // Assuming 'rawData' is the parsed JSON object from the YouTube API response const aboutChannel = new AboutChannelView(rawData); console.log(aboutChannel.subscriber_count); console.log(aboutChannel.description); ``` -------------------------------- ### GET /getHomeFeed Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Kids Retrieves the home feed content for the YouTube Kids client. ```APIDOC ## GET /getHomeFeed ### Description Retrieves the home feed for the YouTube Kids client. ### Method GET ### Response #### Success Response (200) - **feed** (HomeFeed) - The home feed data structure. ``` -------------------------------- ### Instantiate ThumbnailOverlayPinking Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/ThumbnailOverlayPinking Demonstrates the constructor usage for the ThumbnailOverlayPinking node. It requires a raw data object as input to initialize the node properties. ```typescript import { ThumbnailOverlayPinking } from "./parser/classes/ThumbnailOverlayPinking"; const rawData = { /* Raw node data from API */ }; const overlay = new ThumbnailOverlayPinking(rawData); ``` -------------------------------- ### GET /channel Source: https://ytjs.dev/api/classes/Innertube Retrieves channel details and metadata. ```APIDOC ## GET /channel ### Description Fetches channel information based on the provided channel ID. ### Method GET ### Endpoint Innertube.getChannel(id) ### Parameters #### Path Parameters - **id** (string) - Required - The channel ID. ### Request Example ```javascript const channel = await innertube.getChannel('UC_x5XG1OV2P6uZZ5FSM9Ttw'); ``` ### Response #### Success Response (200) - **Channel** (Object) - The channel data object. #### Response Example { "name": "Channel Name", "id": "UC_x5XG1OV2P6uZZ5FSM9Ttw" } ``` -------------------------------- ### GET /TabbedFeed/tabs Source: https://ytjs.dev/api/youtubei.js/namespaces/Mixins/classes/TabbedFeed Retrieves the list of available tabs within the current feed structure. ```APIDOC ## GET /TabbedFeed/tabs ### Description Returns an array of strings representing the available tabs in the TabbedFeed. ### Method GET ### Endpoint /TabbedFeed/tabs ### Response #### Success Response (200) - **tabs** (string[]) - List of tab identifiers. #### Response Example { "tabs": ["Home", "Videos", "Playlists", "Community"] } ``` -------------------------------- ### Instantiating SharedPost Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/SharedPost Demonstrates how to instantiate the SharedPost class using raw data from the YouTube API. This constructor initializes the node with its properties such as author, content, and original post data. ```typescript import { SharedPost } from "./src/parser/classes/SharedPost"; // Example instantiation with raw API data const rawData = { /* ... raw node data from API ... */ }; const sharedPost = new SharedPost(rawData); console.log(sharedPost.id); console.log(sharedPost.author); ``` -------------------------------- ### GET /getChannel Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Kids Retrieves channel details for a specific YouTube Kids channel ID. ```APIDOC ## GET /getChannel ### Description Fetches information for a specific channel. ### Method GET ### Parameters #### Query Parameters - **channel_id** (string) - Required - The ID of the channel to retrieve. ### Response #### Success Response (200) - **channel** (Channel) - The channel object containing channel details. ``` -------------------------------- ### Initialize VideoAttributeView Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/VideoAttributeView Demonstrates how to instantiate the VideoAttributeView class by passing raw node data to the constructor. ```typescript import { VideoAttributeView } from "src/parser/classes/VideoAttributeView"; const rawData = { /* Raw node data from API response */ }; const videoAttribute = new VideoAttributeView(rawData); ``` -------------------------------- ### Instantiate BackstageImage Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/BackstageImage Demonstrates how to initialize a new BackstageImage instance by passing raw node data to the constructor. This is typically used within the library's internal parsing logic. ```typescript import { BackstageImage } from "./src/parser/classes/BackstageImage"; const rawData = { /* raw node data from API */ }; const backstageImage = new BackstageImage(rawData); console.log(backstageImage.type); // 'BackstageImage' ``` -------------------------------- ### GET /getPostComments Source: https://ytjs.dev/api/classes/Innertube Retrieves comments for a specific community post. ```APIDOC ## GET /getPostComments ### Description Fetches the comment thread for a specific post within a channel. ### Method GET ### Endpoint /getPostComments ### Parameters #### Query Parameters - **post_id** (string) - Required - The ID of the post. - **channel_id** (string) - Required - The ID of the channel owning the post. - **sort_by** ("TOP_COMMENTS" | "NEWEST_FIRST") - Optional - Sorting preference. ### Response #### Success Response (200) - **Comments** (object) - The list of comments for the post. #### Response Example { "comments": [], "total_count": 50 } ``` -------------------------------- ### GET /video/download Source: https://ytjs.dev/api/classes/Innertube Downloads a video stream as a readable stream. ```APIDOC ## GET /video/download ### Description Downloads a given video as a ReadableStream. For direct links, use getStreamingData instead. ### Method GET ### Endpoint Innertube.download(video_id, options?) ### Parameters #### Path Parameters - **video_id** (string) - Required - The video id. #### Request Body - **options** (DownloadOptions) - Optional - Download configuration options. ### Request Example ```javascript const stream = await innertube.download('dQw4w9WgXcQ'); ``` ### Response #### Success Response (200) - **ReadableStream** (Uint8Array) - A stream of the video data. #### Response Example { "status": "streaming" } ``` -------------------------------- ### LiveChat Initialization and Events Source: https://ytjs.dev/api/youtubei.js/namespaces/YT/classes/LiveChat Constructs a new LiveChat instance and sets up event listeners for real-time chat updates. ```APIDOC ## POST /LiveChat/Constructor ### Description Initializes a new LiveChat instance for a specific video. ### Parameters #### Request Body - **video_info** (VideoInfo) - Required - The video information object containing chat context. ### Request Example { "video_info": { "id": "VIDEO_ID" } } ## GET /LiveChat/on ### Description Registers event listeners for live chat stream updates. ### Parameters #### Query Parameters - **type** (string) - Required - Event type: "start", "chat-update", "metadata-update", or "error". - **listener** (function) - Required - Callback function to execute when the event triggers. ### Response Example { "status": "listener_registered" } ``` -------------------------------- ### GET /download Source: https://ytjs.dev/api/youtubei.js/namespaces/YTShorts/classes/ShortFormVideoInfo Downloads the video stream based on provided format options. ```APIDOC ## GET /download ### Description Downloads the video content as a ReadableStream. ### Method GET ### Endpoint /download ### Parameters #### Query Parameters - **options** (DownloadOptions) - Optional - Configuration for the download stream. ### Request Example { "quality": "1080p" } ### Response #### Success Response (200) - **stream** (ReadableStream) - The video data stream. ``` -------------------------------- ### Instantiate and use WatchEndpoint Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/WatchEndpoint Demonstrates how to initialize the WatchEndpoint class with raw data and utilize its methods to build a request or retrieve the API path. ```typescript import { WatchEndpoint } from "./src/parser/classes/endpoints/WatchEndpoint"; // Initialize with raw node data const endpoint = new WatchEndpoint(rawData); // Get the API path for the endpoint const path = endpoint.getApiPath(); // Build the request object const request = endpoint.buildRequest(); ``` -------------------------------- ### Create Player instance from source Source: https://ytjs.dev/api/classes/Player Shows the static factory method to create a Player instance from a source ID and initialization options. This is the primary way to bootstrap the player script for a specific video context. ```typescript const player = await Player.fromSource('player_id_string', { cache: myCacheInstance, fetch: fetch }); ``` -------------------------------- ### GET /LibraryContinuation Source: https://ytjs.dev/api/youtubei.js/namespaces/YTMusic/classes/LibraryContinuation Handles the retrieval and management of paginated library content within YouTube Music. ```APIDOC ## GET /LibraryContinuation ### Description Represents a continuation object for library shelves or grids, allowing for the retrieval of additional items in a paginated list. ### Method GET ### Endpoint /parser/ytmusic/LibraryContinuation ### Parameters #### Path Parameters - **response** (ApiResponse) - Required - The raw API response object. - **actions** (Actions) - Required - The actions handler instance. ### Request Example N/A (Class instantiation) ### Response #### Success Response (200) - **contents** (MusicShelfContinuation | GridContinuation) - The continuation content. - **has_continuation** (boolean) - Indicates if more pages are available. - **page** (IBrowseResponse) - The underlying browse response data. ### Methods - **getContinuation()**: Returns a Promise that resolves to a new LibraryContinuation instance for the next page of results. ``` -------------------------------- ### Instantiating and Using Element Class Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/Element Example demonstrating how to instantiate the Element class and utilize its type-checking and casting methods. These methods are essential for safely interacting with parsed YouTube API nodes. ```typescript import { Element } from "./src/parser/classes/Element"; // Instantiation const element = new Element(rawData); // Type checking if (element.is(SomeNodeClass)) { console.log("Node is of the expected type"); } // Casting const castedNode = element.as(SomeNodeClass); // Key validation if (element.hasKey("model")) { const model = element.key("model"); } ``` -------------------------------- ### GET /ytkids/homefeed/continuation Source: https://ytjs.dev/api/youtubei.js/namespaces/YTKids/classes/HomeFeed Retrieves the next batch of content for the home feed using continuation tokens. ```APIDOC ## GET /ytkids/homefeed/continuation ### Description Fetches the next page of content for the current feed if a continuation token is available. ### Method GET ### Endpoint /ytkids/homefeed/continuation ### Parameters None ### Response #### Success Response (200) - **data** (Feed) - A new Feed object containing the next batch of items. ### Response Example { "status": "success", "next_page_loaded": true } ``` -------------------------------- ### Instantiate and Interact with MusicHeader Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/MusicHeader Demonstrates how to instantiate the MusicHeader class and utilize its inherited type-checking and casting methods to safely interact with parsed node data. ```typescript import { MusicHeader } from "./src/parser/classes/MusicHeader"; // Instantiate the header with raw data const header = new MusicHeader(rawData); // Check node type if (header.is(MusicHeader)) { console.log("Node is a MusicHeader"); } // Safely access keys if (header.hasKey("title")) { const title = header.key("title"); } ``` -------------------------------- ### Get Up Next Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves the 'up next' queue for a given video ID, with an option for automix. ```APIDOC ## GET /music/upnext/{video_id} ### Description Retrieves the 'up next' queue for a given video ID, with an option for automix. ### Method GET ### Endpoint `/music/upnext/{video_id}` ### Parameters #### Path Parameters - **video_id** (string) - Required - The ID of the video to get the 'up next' queue for. #### Query Parameters - **automix** (boolean) - Optional, defaults to true - Whether to enable automix. #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **PlaylistPanel** (`PlaylistPanel`) - An object containing the 'up next' playlist. #### Response Example ```json { "upNext": "" } ``` ``` -------------------------------- ### Instantiate HowThisWasMadeSectionView Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/HowThisWasMadeSectionView Demonstrates how to initialize the HowThisWasMadeSectionView class using raw node data. This class is typically used within the parser to handle specific YouTube UI components. ```typescript import { HowThisWasMadeSectionView } from "src/parser/classes/HowThisWasMadeSectionView"; const rawData = { /* Raw node data from YouTube API */ }; const sectionView = new HowThisWasMadeSectionView(rawData); console.log(sectionView.section_title); // Accessing parsed properties ``` -------------------------------- ### Get Info Source: https://ytjs.dev/api/youtubei.js/namespaces/Clients/classes/Music Retrieves track information. Can also initiate a radio based on a list item. ```APIDOC ## GET /music/info ### Description Retrieves track information. Passing a list item of type MusicTwoRowItem automatically starts a radio. ### Method GET ### Endpoint `/music/info` ### Parameters #### Path Parameters None #### Query Parameters - **target** (string | NavigationEndpoint | MusicResponsiveListItem | MusicTwoRowItem) - Required - Video ID or a list item. - **options** (Omit) - Optional - Options for fetching video info. #### Request Body None ### Request Example None (GET request) ### Response #### Success Response (200) - **TrackInfo** (`TrackInfo`) - An object containing track details. #### Response Example ```json { "trackInfo": "" } ``` ``` -------------------------------- ### Instantiate ChannelFeaturedContent Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/ChannelFeaturedContent Demonstrates how to initialize the ChannelFeaturedContent class using raw node data from the YouTube API parser. ```typescript import { ChannelFeaturedContent } from "./src/parser/classes/ChannelFeaturedContent"; // Example instantiation with raw data const rawData = { /* ... raw node data ... */ }; const featuredContent = new ChannelFeaturedContent(rawData); console.log(featuredContent.title); // Access the title property console.log(featuredContent.items); // Access the items array ``` -------------------------------- ### GET /search Source: https://ytjs.dev/api/classes/Innertube Performs a search query on YouTube with optional filtering. ```APIDOC ## GET /search ### Description Executes a search query against the YouTube platform and returns the results. ### Method GET ### Endpoint /search ### Parameters #### Query Parameters - **query** (string) - Required - The search term. - **filters** (SearchFilters) - Optional - Search refinement filters. ### Response #### Success Response (200) - **Search** (object) - The search results object. #### Response Example { "results": [], "estimated_results": 1000 } ``` -------------------------------- ### Initialize and Interact with Feed Source: https://ytjs.dev/api/youtubei.js/namespaces/Mixins/classes/Feed Demonstrates how to instantiate a Feed object and retrieve subsequent pages using the continuation method. ```typescript import { Feed } from "./src/core/mixins/Feed"; // Initialize a new feed instance const feed = new Feed(actions, response); // Access feed contents const videos = feed.videos; // Fetch the next batch of content if (feed.has_continuation) { const nextFeed = await feed.getContinuation(); } ``` -------------------------------- ### GET /getPlaylist Source: https://ytjs.dev/api/classes/Innertube Fetches the contents and metadata of a specific YouTube playlist. ```APIDOC ## GET /getPlaylist ### Description Retrieves the full details of a playlist using its unique identifier. ### Method GET ### Endpoint /getPlaylist ### Parameters #### Query Parameters - **id** (string) - Required - The unique ID of the playlist. ### Response #### Success Response (200) - **Playlist** (object) - The playlist data including title, author, and video list. #### Response Example { "id": "PL12345", "title": "My Playlist", "videos": [] } ``` -------------------------------- ### Instantiate MusicResponsiveListItemFlexColumn Source: https://ytjs.dev/api/youtubei.js/namespaces/YTNodes/classes/MusicResponsiveListItemFlexColumn Demonstrates how to create a new instance of the MusicResponsiveListItemFlexColumn class by passing raw node data to the constructor. ```typescript import { MusicResponsiveListItemFlexColumn } from "./src/parser/classes/MusicResponsiveListItemFlexColumn"; const rawData = { /* RawNode data from API */ }; const flexColumn = new MusicResponsiveListItemFlexColumn(rawData); ``` -------------------------------- ### GET /streamingData Source: https://ytjs.dev/api/interfaces/IRawResponse Retrieves the streaming configuration for a video, including adaptive formats and manifest URLs. ```APIDOC ## GET /streamingData ### Description Provides the streaming data object containing format information and manifest URLs for video playback. ### Method GET ### Endpoint /streamingData ### Parameters #### Response Body - **adaptiveFormats** (RawNode[]) - Required - List of adaptive streaming formats. - **dashManifestUrl** (string) - Optional - URL for the DASH manifest. - **expiresInSeconds** (string) - Required - Expiration time for the streaming data. - **formats** (RawNode[]) - Required - List of standard video formats. - **hlsManifestUrl** (string) - Optional - URL for the HLS manifest. - **serverAbrStreamingUrl** (string) - Optional - URL for server-side ABR streaming. ### Response Example { "adaptiveFormats": [], "expiresInSeconds": "3600", "formats": [] } ``` -------------------------------- ### getVideosFromMemo() Source: https://ytjs.dev/api/youtubei.js/namespaces/YT/classes/Search Gets all videos on a given page via memoization. This is a static method inherited from the Feed mixin. ```APIDOC ## GET /websites/ytjs_dev_api/getVideosFromMemo ### Description Get all videos on a given page via memo. ### Method GET ### Endpoint /websites/ytjs_dev_api/getVideosFromMemo ### Parameters #### Query Parameters - **memo** (Memo) - Required - The memo object containing video data. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **videos** (ObservedArray) - An array of videos. #### Response Example ```json { "videos": [ { ... CompactVideo object ... }, { ... GridVideo object ... }, ... ] } ``` ``` -------------------------------- ### AccountManager - getSettings Source: https://ytjs.dev/api/youtubei.js/namespaces/Managers/classes/AccountManager.html Retrieves the YouTube settings for the signed-in account. ```APIDOC ## GET /account/settings ### Description Gets YouTube settings for the signed-in account. ### Method GET ### Endpoint /account/settings ### Response #### Success Response (200) - **settings** (Settings) - An object containing YouTube settings. #### Response Example ```json { "settings": { "language": "en", "country": "US", "privacy": { "history": "on", "subscriptions": "private" } } } ``` ```