Skip to main content

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.

The browse API covers all non-search content discovery: artist profiles, albums, playlists, the home feed, mood/genre pages, charts, and podcasts. Every function is a suspend extension on the YouTube object and returns a Result<T> that wraps a strongly-typed page model.

YouTube.artist

Fetches an artist’s profile page, including all carousel sections (songs, albums, singles, videos, playlists, and artist bio).
suspend fun artist(browseId: String): Result<ArtistPage>
browseId
String
required
The artist’s InnerTube browse ID, typically starting with UC. Obtained from ArtistItem.id or navigation endpoints in other responses.
Return type
Result<ArtistPage>
Result
Example
YouTube.artist("UCT9zcQNlyht7fRlcjmflRSA").onSuccess { page ->
    println(page.artist.title)
    page.sections.forEach { section ->
        println("${section.title}: ${section.items.size} items")
    }
}

YouTube.album

Loads the full album browse page including metadata and the complete song list.
suspend fun album(browseId: String, withSongs: Boolean = true): Result<AlbumPage>
browseId
String
required
The album’s browse ID (e.g. MPREb_...). Obtained from AlbumItem.browseId.
withSongs
Boolean
When true (default), also fetches the full song list via albumSongs(). Pass false to skip the extra request and get only album metadata.
Return type
Result<AlbumPage>
Result
Example
YouTube.album("MPREb_SnLwzL2hMKS").onSuccess { page ->
    println("${page.album.title} (${page.album.year})")
    page.songs.forEachIndexed { i, song ->
        println("${i + 1}. ${song.title}")
    }
}

YouTube.albumSongs

Fetches the complete list of songs for an album playlist, handling pagination automatically (up to 50 continuation requests).
suspend fun albumSongs(playlistId: String, album: AlbumItem? = null): Result<List<SongItem>>
playlistId
String
required
The playlist ID backing the album, available as AlbumItem.playlistId. The function prepends VL automatically.
album
AlbumItem?
Optional album context used to back-fill album metadata (title, artists, thumbnail) on each SongItem. Defaults to null.
Return type
Result<List<SongItem>>
Result
All songs on the album, fully paginated.
Example
YouTube.albumSongs("OLAK5uy_lC...").onSuccess { songs ->
    songs.forEach { println(it.title) }
}

YouTube.playlist

Fetches a playlist’s header metadata and the first page of songs.
suspend fun playlist(playlistId: String): Result<PlaylistPage>
playlistId
String
required
The playlist ID (without the VL prefix). The function prepends VL internally.
Return type
Result<PlaylistPage>
Result
Example
YouTube.playlist("PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI").onSuccess { page ->
    println("${page.playlist.title}${page.playlist.songCountText}")
    page.songs.forEach { println("  ${it.title} [setVideoId=${it.setVideoId}]") }
}

YouTube.playlistContinuation

Fetches the next page of songs for a playlist using a continuation token.
suspend fun playlistContinuation(continuation: String): Result<PlaylistContinuationPage>
continuation
String
required
Continuation token from PlaylistPage.songsContinuation, PlaylistPage.continuation, or a prior PlaylistContinuationPage.continuation.
Return type
Result<PlaylistContinuationPage>
Result
Example
var token = page.songsContinuation
while (token != null) {
    YouTube.playlistContinuation(token).onSuccess { cont ->
        cont.songs.forEach { println(it.title) }
        token = cont.continuation
    }.onFailure { token = null }
}

YouTube.home

Fetches the YouTube Music home feed, which contains personalized carousels and an optional chip-filter bar.
suspend fun home(continuation: String? = null, params: String? = null): Result<HomePage>
continuation
String?
If provided, delegates to the internal homeContinuation() helper to fetch additional sections from a prior HomePage.continuation token.
params
String?
Optional browse params passed to the FEmusic_home browse ID.
Return type
Result<HomePage>
Result
Example
YouTube.home().onSuccess { feed ->
    feed.chips?.forEach { println("Chip: ${it.title}") }
    feed.sections.forEach { section ->
        println("${section.title}: ${section.items.size} items")
    }
}

YouTube.explore

Fetches the Explore page, which surfaces new-release albums and a preview of the mood-and-genres grid.
suspend fun explore(): Result<ExplorePage>
Return type
Result<ExplorePage>
Result
Example
YouTube.explore().onSuccess { page ->
    page.newReleaseAlbums.take(5).forEach { println(it.title) }
}

YouTube.moodAndGenres

Fetches the complete mood-and-genres grid from the FEmusic_moods_and_genres browse ID.
suspend fun moodAndGenres(): Result<List<MoodAndGenres>>
Return type
Result<List<MoodAndGenres>>
Result
Each MoodAndGenres represents a category section containing navigation buttons (e.g. “Commute”, “Focus”, “Hip-Hop”).
Example
YouTube.moodAndGenres().onSuccess { categories ->
    categories.forEach { cat -> println(cat.title) }
}

YouTube.getChartsPage

Fetches the YouTube Music charts page (FEmusic_charts), organised into typed sections.
suspend fun getChartsPage(continuation: String? = null): Result<ChartsPage>
continuation
String?
Pass a ChartsPage.continuation token to fetch additional sections.
Return type
Result<ChartsPage>
Result
Example
YouTube.getChartsPage().onSuccess { charts ->
    charts.sections.forEach { section ->
        println("${section.title} [${section.chartType}]")
        section.items.take(3).forEach { println("  ${it.title}") }
    }
}

YouTube.podcast

Fetches a podcast show page with episode list.
suspend fun podcast(podcastId: String): Result<PodcastPage>
podcastId
String
required
The podcast browse ID. Obtained from PodcastItem.id.
Return type
Result<PodcastPage>
Result
PodcastPage with podcast: PodcastItem, episodes: List<EpisodeItem>, continuation: String?, and isChannelSubscribed: Boolean.

YouTube.artistItems

Fetches the full item list for a single artist section (e.g. all songs, all albums).
suspend fun artistItems(endpoint: BrowseEndpoint): Result<ArtistItemsPage>
endpoint
BrowseEndpoint
required
The moreEndpoint from ArtistSection.moreEndpoint.
Return type
Result<ArtistItemsPage>
Result
ArtistItemsPage with title: String, items: List<YTItem>, and continuation: String?.

YouTube.artistItemsContinuation

Fetches the next page of an artist section started with artistItems().
suspend fun artistItemsContinuation(continuation: String): Result<ArtistItemsContinuationPage>
continuation
String
required
Token from ArtistItemsPage.continuation.
Return type
Result<ArtistItemsContinuationPage>
Result
ArtistItemsContinuationPage with items: List<YTItem> and continuation: String?.

Fetches the “Related” panel for a currently-playing track.
suspend fun related(endpoint: BrowseEndpoint): Result<RelatedPage>
endpoint
BrowseEndpoint
required
The relatedEndpoint from a NextResult.
Return type
RelatedPage with songs: List<SongItem>, albums: List<AlbumItem>, artists: List<ArtistItem>, and playlists: List<PlaylistItem>.
Example
YouTube.next(WatchEndpoint(videoId = "dQw4w9WgXcQ")).onSuccess { nextResult ->
    nextResult.relatedEndpoint?.let { endpoint ->
        YouTube.related(endpoint).onSuccess { related ->
            related.songs.forEach { println(it.title) }
        }
    }
}

Build docs developers (and LLMs) love