Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/faraasaaay/innertube-v2/llms.txt

Use this file to discover all available pages before exploring further.

The Browse API surfaces the YouTube Music home feed, charts, artist pages, album pages, and the generic browse endpoint. All methods are suspend functions on the YouTube singleton and return Result<T>.

YouTube.home()

Fetches the YouTube Music home feed, optionally filtered by a chip (genre/mood category) or paginated with a continuation token.
suspend fun home(
    continuation: String? = null,
    params: String? = null,
): Result<HomePage>
continuation
String?
Continuation token from a previous HomePage.continuation. Pass null to load the first page.
params
String?
Optional encoded params string, used when selecting a chip to filter the feed (e.g. by genre). Comes from HomePage.Chip.endpoint.params.

Returns

Result<HomePage>
chips
List<Chip>?
Genre/mood filter chips shown at the top of the feed.
sections
List<Section>
Ordered content carousels on the home page.
continuation
String?
Token for the next page of the feed. null on the last page.

Example

var page = YouTube.home().getOrThrow()
page.chips?.forEach { println("Chip: ${it.title}") }
page.sections.forEach { section ->
    println("=== ${section.title} (${section.items.size} items) ===")
}

// Load next page
page.continuation?.let { token ->
    val nextPage = YouTube.home(continuation = token).getOrThrow()
}

YouTube.explore()

Fetches the Explore page, providing new release albums and a list of mood/genre categories.
suspend fun explore(): Result<ExplorePage>

Returns

Result<ExplorePage>
newReleaseAlbums
List<AlbumItem>
Recently released albums surfaced on the Explore page.
moodAndGenres
List<MoodAndGenres.Item>
Mood and genre navigation items. Each Item has title: String, stripeColor: Long, and endpoint: BrowseEndpoint.

YouTube.newReleaseAlbums()

Fetches only the new-release albums shelf without the rest of the Explore page.
suspend fun newReleaseAlbums(): Result<List<AlbumItem>>

Returns

Result<List<AlbumItem>> — a flat list of recently released AlbumItem entries.

YouTube.moodAndGenres()

Fetches only the mood-and-genre navigation grid without the rest of the Explore page.
suspend fun moodAndGenres(): Result<List<MoodAndGenres>>

Returns

Result<List<MoodAndGenres>> — each MoodAndGenres has:
title
String
Section heading (e.g. "Moods & moments", "Genres").
items
List<MoodAndGenres.Item>
Individual navigation buttons.

YouTube.getChartsPage()

Fetches the YouTube Music Charts page with trending, top, genre, and new-release chart sections.
suspend fun getChartsPage(continuation: String? = null): Result<ChartsPage>
continuation
String?
Continuation token from ChartsPage.continuation. Pass null for the first page.

Returns

Result<ChartsPage>
sections
List<ChartSection>
Chart sections, each representing a different ranking category.
continuation
String?
Token for loading more chart sections. null on the last page.

YouTube.artist()

Fetches a full artist page including their content sections, biography, and subscriber/listener counts.
suspend fun artist(browseId: String): Result<ArtistPage>
browseId
String
required
The artist browse ID, always beginning with "UC" (e.g. "UCiMhD4jzUqG-IgPzUmmytRQ").

Returns

Result<ArtistPage>
artist
ArtistItem
Core artist metadata.
sections
List<ArtistSection>
Content carousels on the artist page (e.g. “Songs”, “Albums”, “Singles”, “Videos”, “Playlists”, “Fans also like”).
description
String?
Plain-text artist biography.
subscriberCountText
String?
Formatted subscriber count (e.g. "12.5M subscribers").
monthlyListenerCount
String?
Formatted monthly listener count (e.g. "25,123,456 monthly listeners").

YouTube.artistItems()

Fetches the full item list for a specific section on an artist page (e.g. all albums, all singles).
suspend fun artistItems(endpoint: BrowseEndpoint): Result<ArtistItemsPage>
endpoint
BrowseEndpoint
required
The moreEndpoint from an ArtistSection. Contains the browseId and optional params needed to identify the section.

Returns

Result<ArtistItemsPage>
title
String
Section title (e.g. "Albums", "Singles").
items
List<YTItem>
All items for this section. May include SongItem, AlbumItem, PlaylistItem depending on the section type.
continuation
String?
Token for further pagination via artistItemsContinuation(). null when all items fit on the first page.

YouTube.artistItemsContinuation()

Paginates through the results of artistItems().
suspend fun artistItemsContinuation(continuation: String): Result<ArtistItemsContinuationPage>
continuation
String
required
Continuation token from ArtistItemsPage.continuation.

Returns

Result<ArtistItemsContinuationPage>
items
List<YTItem>
Next page of items.
continuation
String?
Next continuation token. null on the last page.

YouTube.album()

Fetches a full album page including all tracks, alternative versions, and related releases.
suspend fun album(
    browseId: String,
    withSongs: Boolean = true,
): Result<AlbumPage>
browseId
String
required
The album browse ID, typically starting with "MPREb_" (e.g. "MPREb_0PuM9dwW3D").
withSongs
Boolean
When true (default), the implementation makes an additional request to fetch all tracks in the album’s underlying playlist, including continuation pages. Set to false to skip track loading for faster metadata-only fetches.

Returns

Result<AlbumPage>
album
AlbumItem
Album metadata.
songs
List<SongItem>
All tracks on the album. Empty when withSongs = false.
otherVersions
List<AlbumItem>
Alternative editions of the same release (e.g. Deluxe, Explicit, Remastered).
releasesForYou
List<AlbumItem>
Related releases by the same artist or in the same style (the “More from artist” / “Releases for you” carousel).
description
String?
Plain-text album description.

YouTube.browse()

Generic browse endpoint for any InnerTube browse ID that doesn’t have a dedicated method.
suspend fun browse(browseId: String, params: String?): Result<BrowseResult>
browseId
String
required
Any InnerTube browse ID.
params
String?
Optional URL-safe base64 params string to pass alongside the browse ID.

Returns

Result<BrowseResult>
title
String?
Page title, if present in the response header.
items
List<BrowseResult.Item>
Grouped content shelves.

Fetches the “Related” tab content for a currently-playing track — similar songs, albums, artists, and playlists.
suspend fun related(endpoint: BrowseEndpoint): Result<RelatedPage>
endpoint
BrowseEndpoint
required
The related browse endpoint from NextResult.relatedEndpoint.

Returns

Result<RelatedPage>
songs
List<SongItem>
Audio tracks determined to be related. Only MUSIC_VIDEO_TYPE_ATV items are included.
albums
List<AlbumItem>
Related albums.
artists
List<ArtistItem>
Related artists.
playlists
List<PlaylistItem>
Related playlists.

Artist & Album browsing example

import com.music.innertube.YouTube

// ── Artist page ─────────────────────────────────────────────────────────────
val artistPage = YouTube.artist("UCiMhD4jzUqG-IgPzUmmytRQ").getOrThrow()
println("${artistPage.artist.title}${artistPage.subscriberCountText}")
artistPage.sections.forEach { section ->
    println("  Section: ${section.title} (${section.items.size} items)")
}

// Load all albums for the artist
val albumsSection = artistPage.sections.firstOrNull { it.title == "Albums" }
albumsSection?.moreEndpoint?.let { ep ->
    var albumsPage = YouTube.artistItems(ep).getOrThrow()
    println("Albums: ${albumsPage.items.size}")

    var token = albumsPage.continuation
    while (token != null) {
        val next = YouTube.artistItemsContinuation(token).getOrThrow()
        albumsPage = albumsPage.copy(items = albumsPage.items + next.items)
        token = next.continuation
    }
}

// ── Album page ───────────────────────────────────────────────────────────────
val albumPage = YouTube.album("MPREb_0PuM9dwW3D").getOrThrow()
println("${albumPage.album.title} (${albumPage.album.year}) — ${albumPage.songs.size} tracks")
albumPage.songs.forEachIndexed { i, song ->
    println("  ${i + 1}. ${song.title}")
}
println("Other versions: ${albumPage.otherVersions.map { it.title }}")

Build docs developers (and LLMs) love