Documentation Index
Fetch the complete documentation index at: https://mintlify.com/faraasaaay/inner/llms.txt
Use this file to discover all available pages before exploring further.
YTItem is a sealed class that represents all content types returned by Inner. Every item has a common set of base properties plus type-specific fields. All four concrete subtypes — SongItem, AlbumItem, PlaylistItem, and ArtistItem — are data class implementations, making them safe to use in when expressions, copy() calls, and equality checks.
Base properties
AllYTItem subtypes share the following abstract properties:
Unique content identifier. For songs this is the
videoId; for albums and artists it is the browseId; for playlists it is the playlistId (without the VL prefix).The display title of the content item.
URL of the highest-quality thumbnail image available. May be
null for some artist items.true if the content is marked with an explicit badge (MUSIC_EXPLICIT_BADGE). Always false for PlaylistItem and ArtistItem.The full YouTube Music share URL for the item. The format differs by subtype — see each subtype section for the exact pattern.
SongItem
Represents a single track on YouTube Music.The YouTube video ID (e.g.
"dQw4w9WgXcQ").The track title.
The list of credited artists. Each
Artist has:The album this song belongs to, or
null if not available. Album has:Duration of the track in seconds. May be
null when parsed from contexts that do not include duration (e.g. artist page song lists).Position in a chart ranking, if the song was returned as part of a charts page.
null otherwise.Change indicator for the chart position (e.g.
"up", "down"). null when not from a charts context.URL of the track’s thumbnail image. Non-nullable for
SongItem.true if the track has an explicit content badge.The playback endpoint for this track. Contains
videoId and optionally playlistId, params, and index. Pass this to a player to begin playback.A per-entry playlist operation ID. Only populated when the
SongItem was parsed from a playlist (via PlaylistPage). Required for operations like removing a specific entry from a playlist.Always
https://music.youtube.com/watch?v={id}.AlbumItem
Represents a full album (studio album, EP, single, or compilation).The album’s browse ID (e.g.
"MPREb_xxxxxxxxxxxx"). Used to fetch full album data via YouTube.album() or PortableInnertube.album().The associated playlist ID (e.g.
"OLAK5uy_xxxx"). Used to fetch the album’s track listing.Defaults to
browseId. Satisfies the YTItem contract.The album title.
The credited artists. May be
null when the album is parsed from carousel renderers that do not include artist subtitle runs.The release year, parsed from subtitle text.
null if not present.URL of the album artwork thumbnail.
true if the album carries an explicit badge.Always
https://music.youtube.com/playlist?list={playlistId}.PlaylistItem
Represents a user-created or editorial playlist on YouTube Music.The playlist ID without the
VL prefix (e.g. "PLxxxxxxxxxxxxxxxxxx").The playlist title.
The playlist creator. The
Artist.id field is populated when the author has a linked browse endpoint; otherwise it is null.A human-readable song count string (e.g.
"42"), as returned by the API. May be null.URL of the playlist thumbnail. May be
null for some playlist contexts.The watch endpoint for playing the playlist from the beginning.
The watch endpoint for shuffling the playlist.
The watch endpoint for starting a radio based on the playlist.
true when the authenticated user owns and can edit this playlist. Derived from the presence of a musicEditablePlaylistDetailHeaderRenderer in the browse response.Always
false for PlaylistItem.Always
https://music.youtube.com/playlist?list={id}.ArtistItem
Represents a music artist or channel on YouTube Music.The artist’s browse ID, which is always a channel ID of the form
"UCxxxxxxxxxxxxxxxxxxxxxx".The artist’s display name.
URL of the artist’s profile image. May be
null.The YouTube channel ID for the subscribe button, sourced from the
subscribeButtonRenderer. May differ from id in some renderer contexts; usually null when parsed from search or carousel renderers.Endpoint to begin playing the artist’s top songs.
Endpoint to shuffle the artist’s songs.
Endpoint to start a radio based on the artist.
Always
false for ArtistItem.Always
https://music.youtube.com/channel/{id}.Utility extensions
Two generic extension functions are available on anyList<T : YTItem>:
filterExplicit
enabled is true (the default), returns a new list with all items where explicit == true removed. When enabled is false, the original list is returned unchanged. Useful for implementing a user-controlled explicit content filter.
filterVideo
enabled is true, removes SongItem entries whose endpoint has a musicVideoType of MUSIC_VIDEO_TYPE_OMV (Official Music Video) or MUSIC_VIDEO_TYPE_UGC (user-generated content). Non-song items are always kept. Use this to restrict results to audio-only tracks.
Type-checking pattern
Use awhen expression to branch on the concrete YTItem subtype:
YTItem is a sealed class, the Kotlin compiler guarantees exhaustiveness — you will get a compile-time warning if a new subtype is added and your when does not cover it.