[youtubei.js](../README.md) / Innertube # Class: Innertube Provides access to various services and modules in the YouTube API. ## Constructors ### new Innertube() > **new Innertube**(`session`): [`Innertube`](Innertube.md) #### Parameters • **session**: [`Session`](Session.md) #### Returns [`Innertube`](Innertube.md) #### Defined in [src/Innertube.ts:59](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L59) ## Accessors ### account > `get` **account**(): [`AccountManager`](../namespaces/Managers/classes/AccountManager.md) An interface for managing and retrieving account information. #### Returns [`AccountManager`](../namespaces/Managers/classes/AccountManager.md) #### Defined in [src/Innertube.ts:478](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L478) *** ### actions > `get` **actions**(): [`Actions`](Actions.md) An internal class used to dispatch requests. #### Returns [`Actions`](Actions.md) #### Defined in [src/Innertube.ts:499](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L499) *** ### interact > `get` **interact**(): [`InteractionManager`](../namespaces/Managers/classes/InteractionManager.md) An interface for directly interacting with certain YouTube features. #### Returns [`InteractionManager`](../namespaces/Managers/classes/InteractionManager.md) #### Defined in [src/Innertube.ts:492](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L492) *** ### kids > `get` **kids**(): [`Kids`](../namespaces/Clients/classes/Kids.md) An interface for interacting with YouTube Kids. #### Returns [`Kids`](../namespaces/Clients/classes/Kids.md) #### Defined in [src/Innertube.ts:471](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L471) *** ### music > `get` **music**(): [`Music`](../namespaces/Clients/classes/Music.md) An interface for interacting with YouTube Music. #### Returns [`Music`](../namespaces/Clients/classes/Music.md) #### Defined in [src/Innertube.ts:457](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L457) *** ### playlist > `get` **playlist**(): [`PlaylistManager`](../namespaces/Managers/classes/PlaylistManager.md) An interface for managing playlists. #### Returns [`PlaylistManager`](../namespaces/Managers/classes/PlaylistManager.md) #### Defined in [src/Innertube.ts:485](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L485) *** ### session > `get` **session**(): [`Session`](Session.md) The session used by this instance. #### Returns [`Session`](Session.md) #### Defined in [src/Innertube.ts:506](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L506) *** ### studio > `get` **studio**(): [`Studio`](../namespaces/Clients/classes/Studio.md) An interface for interacting with YouTube Studio. #### Returns [`Studio`](../namespaces/Clients/classes/Studio.md) #### Defined in [src/Innertube.ts:464](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L464) ## Methods ### call() #### call(endpoint, args) > **call**\<`T`\>(`endpoint`, `args`): `Promise`\<`T`\> Utility method to call an endpoint without having to use [Actions](Actions.md). ##### Type Parameters • **T** *extends* [`IParsedResponse`](../namespaces/APIResponseTypes/interfaces/IParsedResponse.md) ##### Parameters • **endpoint**: [`NavigationEndpoint`](../namespaces/YTNodes/classes/NavigationEndpoint.md) The endpoint to call. • **args** Call arguments. • **args.parse**: `true` ##### Returns `Promise`\<`T`\> ##### Defined in [src/Innertube.ts:448](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L448) #### call(endpoint, args) > **call**(`endpoint`, `args`?): `Promise`\<[`ApiResponse`](../interfaces/ApiResponse.md)\> ##### Parameters • **endpoint**: [`NavigationEndpoint`](../namespaces/YTNodes/classes/NavigationEndpoint.md) • **args?** • **args.parse?**: `false` ##### Returns `Promise`\<[`ApiResponse`](../interfaces/ApiResponse.md)\> ##### Defined in [src/Innertube.ts:449](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L449) *** ### download() > **download**(`video_id`, `options`?): `Promise`\<`ReadableStream`\<`Uint8Array`\>\> Downloads a given video. If all you need the direct download link, see [getStreamingData](Innertube.md#getstreamingdata). If you wish to retrieve the video info too, have a look at [getBasicInfo](Innertube.md#getbasicinfo) or [getInfo](Innertube.md#getinfo). #### Parameters • **video\_id**: `string` The video id. • **options?**: [`DownloadOptions`](../namespaces/Types/interfaces/DownloadOptions.md) Download options. #### Returns `Promise`\<`ReadableStream`\<`Uint8Array`\>\> #### Defined in [src/Innertube.ts:423](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L423) *** ### getBasicInfo() > **getBasicInfo**(`video_id`, `client`?): `Promise`\<[`VideoInfo`](../namespaces/YT/classes/VideoInfo.md)\> #### Parameters • **video\_id**: `string` • **client?**: [`InnerTubeClient`](../namespaces/Types/type-aliases/InnerTubeClient.md) #### Returns `Promise`\<[`VideoInfo`](../namespaces/YT/classes/VideoInfo.md)\> #### Defined in [src/Innertube.ts:107](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L107) *** ### getChannel() > **getChannel**(`id`): `Promise`\<[`Channel`](../namespaces/YT/classes/Channel.md)\> #### Parameters • **id**: `string` #### Returns `Promise`\<[`Channel`](../namespaces/YT/classes/Channel.md)\> #### Defined in [src/Innertube.ts:331](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L331) *** ### getChannelsFeed() > **getChannelsFeed**(): `Promise`\<[`Feed`](../namespaces/Mixins/classes/Feed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Returns `Promise`\<[`Feed`](../namespaces/Mixins/classes/Feed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Defined in [src/Innertube.ts:324](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L324) *** ### getComments() > **getComments**(`video_id`, `sort_by`?, `comment_id`?): `Promise`\<[`Comments`](../namespaces/YT/classes/Comments.md)\> #### Parameters • **video\_id**: `string` • **sort\_by?**: `"TOP_COMMENTS"` \| `"NEWEST_FIRST"` • **comment\_id?**: `string` #### Returns `Promise`\<[`Comments`](../namespaces/YT/classes/Comments.md)\> #### Defined in [src/Innertube.ts:250](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L250) *** ### getGuide() > **getGuide**(): `Promise`\<[`Guide`](../namespaces/YT/classes/Guide.md)\> Retrieves YouTube's content guide. #### Returns `Promise`\<[`Guide`](../namespaces/YT/classes/Guide.md)\> #### Defined in [src/Innertube.ts:291](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L291) *** ### getHashtag() > **getHashtag**(`hashtag`): `Promise`\<[`HashtagFeed`](../namespaces/YT/classes/HashtagFeed.md)\> #### Parameters • **hashtag**: `string` #### Returns `Promise`\<[`HashtagFeed`](../namespaces/YT/classes/HashtagFeed.md)\> #### Defined in [src/Innertube.ts:378](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L378) *** ### getHistory() > **getHistory**(): `Promise`\<[`History`](../namespaces/YT/classes/History.md)\> #### Returns `Promise`\<[`History`](../namespaces/YT/classes/History.md)\> #### Defined in [src/Innertube.ts:303](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L303) *** ### getHomeFeed() > **getHomeFeed**(): `Promise`\<[`HomeFeed`](../namespaces/YT/classes/HomeFeed.md)\> #### Returns `Promise`\<[`HomeFeed`](../namespaces/YT/classes/HomeFeed.md)\> #### Defined in [src/Innertube.ts:281](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L281) *** ### getInfo() > **getInfo**(`target`, `client`?): `Promise`\<[`VideoInfo`](../namespaces/YT/classes/VideoInfo.md)\> #### Parameters • **target**: `string` \| [`NavigationEndpoint`](../namespaces/YTNodes/classes/NavigationEndpoint.md) • **client?**: [`InnerTubeClient`](../namespaces/Types/type-aliases/InnerTubeClient.md) #### Returns `Promise`\<[`VideoInfo`](../namespaces/YT/classes/VideoInfo.md)\> #### Defined in [src/Innertube.ts:67](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L67) *** ### getLibrary() > **getLibrary**(): `Promise`\<[`Library`](../namespaces/YT/classes/Library.md)\> #### Returns `Promise`\<[`Library`](../namespaces/YT/classes/Library.md)\> #### Defined in [src/Innertube.ts:296](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L296) *** ### getNotifications() > **getNotifications**(): `Promise`\<[`NotificationsMenu`](../namespaces/YT/classes/NotificationsMenu.md)\> #### Returns `Promise`\<[`NotificationsMenu`](../namespaces/YT/classes/NotificationsMenu.md)\> #### Defined in [src/Innertube.ts:339](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L339) *** ### getPlaylist() > **getPlaylist**(`id`): `Promise`\<[`Playlist`](../namespaces/YT/classes/Playlist.md)\> #### Parameters • **id**: `string` #### Returns `Promise`\<[`Playlist`](../namespaces/YT/classes/Playlist.md)\> #### Defined in [src/Innertube.ts:364](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L364) *** ### getPlaylists() > **getPlaylists**(): `Promise`\<[`Feed`](../namespaces/Mixins/classes/Feed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> Retrieves the user's playlists. #### Returns `Promise`\<[`Feed`](../namespaces/Mixins/classes/Feed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Defined in [src/Innertube.ts:357](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L357) *** ### getSearchSuggestions() > **getSearchSuggestions**(`query`): `Promise`\<`string`[]\> #### Parameters • **query**: `string` #### Returns `Promise`\<`string`[]\> #### Defined in [src/Innertube.ts:229](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L229) *** ### getShortsVideoInfo() > **getShortsVideoInfo**(`video_id`, `client`?): `Promise`\<[`ShortFormVideoInfo`](../namespaces/YTShorts/classes/ShortFormVideoInfo.md)\> #### Parameters • **video\_id**: `string` • **client?**: [`InnerTubeClient`](../namespaces/Types/type-aliases/InnerTubeClient.md) #### Returns `Promise`\<[`ShortFormVideoInfo`](../namespaces/YTShorts/classes/ShortFormVideoInfo.md)\> #### Defined in [src/Innertube.ts:124](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L124) *** ### getStreamingData() > **getStreamingData**(`video_id`, `options`): `Promise`\<[`Format`](../namespaces/Misc/classes/Format.md)\> An alternative to [download](Innertube.md#download). Returns deciphered streaming data. If you wish to retrieve the video info too, have a look at [getBasicInfo](Innertube.md#getbasicinfo) or [getInfo](Innertube.md#getinfo). #### Parameters • **video\_id**: `string` The video id. • **options**: [`FormatOptions`](../namespaces/Types/interfaces/FormatOptions.md) = `{}` Format options. #### Returns `Promise`\<[`Format`](../namespaces/Misc/classes/Format.md)\> #### Defined in [src/Innertube.ts:408](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L408) *** ### getSubscriptionsFeed() > **getSubscriptionsFeed**(): `Promise`\<[`Feed`](../namespaces/Mixins/classes/Feed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Returns `Promise`\<[`Feed`](../namespaces/Mixins/classes/Feed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Defined in [src/Innertube.ts:317](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L317) *** ### getTrending() > **getTrending**(): `Promise`\<[`TabbedFeed`](../namespaces/Mixins/classes/TabbedFeed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Returns `Promise`\<[`TabbedFeed`](../namespaces/Mixins/classes/TabbedFeed.md)\<[`IBrowseResponse`](../namespaces/APIResponseTypes/type-aliases/IBrowseResponse.md)\>\> #### Defined in [src/Innertube.ts:310](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L310) *** ### getUnseenNotificationsCount() > **getUnseenNotificationsCount**(): `Promise`\<`number`\> #### Returns `Promise`\<`number`\> #### Defined in [src/Innertube.ts:348](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L348) *** ### resolveURL() > **resolveURL**(`url`): `Promise`\<[`NavigationEndpoint`](../namespaces/YTNodes/classes/NavigationEndpoint.md)\> Resolves the given URL. #### Parameters • **url**: `string` The URL. #### Returns `Promise`\<[`NavigationEndpoint`](../namespaces/YTNodes/classes/NavigationEndpoint.md)\> #### Defined in [src/Innertube.ts:432](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L432) *** ### search() > **search**(`query`, `filters`): `Promise`\<[`Search`](../namespaces/YT/classes/Search.md)\> #### Parameters • **query**: `string` • **filters**: [`SearchFilters`](../namespaces/Types/type-aliases/SearchFilters.md) = `{}` #### Returns `Promise`\<[`Search`](../namespaces/YT/classes/Search.md)\> #### Defined in [src/Innertube.ts:155](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L155) *** ### create() > `static` **create**(`config`): `Promise`\<[`Innertube`](Innertube.md)\> #### Parameters • **config**: [`SessionOptions`](../type-aliases/SessionOptions.md) = `{}` #### Returns `Promise`\<[`Innertube`](Innertube.md)\> #### Defined in [src/Innertube.ts:63](https://github.com/LuanRT/YouTube.js/blob/eb21af33db708f0355f4fb15881f5d4fabc7b06c/src/Innertube.ts#L63)