Documentation Index
Fetch the complete documentation index at: https://mintlify.com/faraasaaay/innertube-v1/llms.txt
Use this file to discover all available pages before exploring further.
YTItem is the sealed class at the heart of InnerTube’s content model. Every piece of content returned by search, browse, library, or related-content endpoints is a subclass of YTItem. Because YTItem is sealed, the Kotlin compiler guarantees exhaustive when expressions — you can never forget to handle a content type.
The sealed class itself declares five abstract properties that every subtype must implement:
The canonical unique identifier for this content item. For songs and episodes this is a YouTube video ID. For albums it is the
browseId. For playlists it is the playlist ID.The human-readable display title of the item.
A URL pointing to the item’s cover art or thumbnail image. May be
null for certain artist or playlist results that lack artwork.true when the item carries an explicit content badge from YouTube Music.A fully-qualified
https://music.youtube.com/… URL that can be shared directly with users or opened in a browser.Subclasses
- SongItem
- AlbumItem
- PlaylistItem
- ArtistItem
- PodcastItem
- EpisodeItem
Represents an audio track — either an official song recording (Computed property:
MUSIC_VIDEO_TYPE_ATV) or a music video. The isVideoSong computed property distinguishes between the two.YouTube video ID (e.g.
dQw4w9WgXcQ).Track title.
Track duration in seconds, or
null if not present in the response.Raw
musicVideoType string from InnerTube (e.g. MUSIC_VIDEO_TYPE_ATV, MUSIC_VIDEO_TYPE_OMV). null for user-uploaded videos.Chart ranking position, present when this song was returned as part of a charts page result.
Direction string indicating chart movement (e.g.
"up", "down", "same"), or null when not in a chart context.Thumbnail URL. Non-nullable for songs.
true if the track carries an explicit badge.The playback endpoint to use when starting this track. May carry playlist context.
Used when reordering or removing a song from a playlist. This is the unique position handle in the playlist, not the video ID.
Feedback token to add this song to the YouTube Music library (Like).
Feedback token to remove this song from the library (Unlike).
Feedback token to remove this song from playback history.
true when this SongItem was created by converting an EpisodeItem via .asSongItem().Present for privately-uploaded songs. Used with
YouTube.deleteUploadedSong().| Property | Type | Description |
|---|---|---|
isVideoSong | Boolean | true when musicVideoType is non-null and is not MUSIC_VIDEO_TYPE_ATV. Indicates the result is a music video rather than an audio-only track. |
Artist and Album
Two small data classes appear as nested properties throughout the model:Utility Extension Functions
Three extension functions onList<T : YTItem> let you filter content lists before displaying them, based on user preferences.
filterExplicit(enabled = false) and filterVideoSongs(disableVideos = false) and filterYoutubeShorts(enabled = false) all return the original list unchanged, so you can always pass a boolean preference flag without needing an if check at the call site.Pattern-Matching on YTItem
BecauseYTItem is a sealed class, when expressions on it are exhaustive. The compiler will warn you if you add a new subtype in the future and forget to handle it.