Skip to main content

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.

Inner provides dedicated methods for every major browsing surface in YouTube Music — the home feed, explore page, new releases, charts, mood & genres, and individual content pages for artists, albums, and playlists. All methods are suspend functions returning a Result<T>.

Home feed

YouTube.home(continuation, params) browses FEmusic_home and returns Result<HomePage>. The HomePage data class contains:
  • chips: List<Chip>? — genre/filter chips shown at the top of the home feed. Each Chip has title: String, endpoint: BrowseEndpoint?, and deselectEndPoint: BrowseEndpoint?.
  • sections: List<Section> — content carousels. Each Section has title: String, label: String?, thumbnail: String?, endpoint: BrowseEndpoint?, and items: List<YTItem>.
  • continuation: String? — token for the next page of sections.
Pass a continuation token to load additional sections. Pass params to apply a chip filter (use the endpoint value from the selected Chip).
val home = YouTube.home().getOrThrow()
home.sections.forEach { section ->
    println("${section.title}: ${section.items.size} items")
}
// Load more sections
if (home.continuation != null) {
    val more = YouTube.home(continuation = home.continuation).getOrThrow()
    more.sections.forEach { section ->
        println("${section.title}: ${section.items.size} items")
    }
}
HomePage also exposes a filterExplicit(enabled: Boolean) method that returns a copy of the page with explicit SongItem entries removed from all sections.

Explore page

YouTube.explore() browses FEmusic_explore and returns Result<ExplorePage>. The ExplorePage data class contains:
  • newReleaseAlbums: List<AlbumItem> — recently released albums pulled from the “New releases” carousel.
  • moodAndGenres: List<MoodAndGenres.Item> — mood & genre navigation buttons, each with title: String, stripeColor: Long, and endpoint: BrowseEndpoint.
val explore = YouTube.explore().getOrThrow()
explore.newReleaseAlbums.forEach { album ->
    println("${album.title} (${album.year})")
}
explore.moodAndGenres.forEach { item ->
    println(item.title)
}
To fetch the full new-releases listing without the mood items, use YouTube.newReleaseAlbums() which returns Result<List<AlbumItem>> by browsing FEmusic_new_releases_albums directly.

Charts

YouTube.getChartsPage(continuation) browses FEmusic_charts and returns Result<ChartsPage>. The ChartsPage data class contains:
  • sections: List<ChartSection> — each section has title: String, items: List<YTItem>, and chartType: ChartType.
  • continuation: String? — token for the next page.
ChartType is an enum with values TRENDING, TOP, GENRE, and NEW_RELEASES. The type is inferred from the section title.
val charts = YouTube.getChartsPage().getOrThrow()
charts.sections.forEach { section ->
    println("=== ${section.title} (${section.chartType}) ===")
    section.items.forEach { println("  ${it.title}") }
}
// Paginate
if (charts.continuation != null) {
    val next = YouTube.getChartsPage(continuation = charts.continuation).getOrThrow()
}
SongItem entries in chart sections may include chartPosition: Int? and chartChange: String? fields populated from the chart ranking column.

Mood & genres

YouTube.moodAndGenres() browses FEmusic_moods_and_genres and returns Result<List<MoodAndGenres>>. Each MoodAndGenres has a title: String and items: List<MoodAndGenres.Item>. Each item has title, stripeColor, and an endpoint: BrowseEndpoint you can pass to YouTube.browse() to load that mood’s playlist grid.
val moods = YouTube.moodAndGenres().getOrThrow()
moods.forEach { group ->
    println("${group.title}: ${group.items.size} moods")
}

Artist pages

YouTube.artist(browseId) returns Result<ArtistPage>. The ArtistPage data class contains:
  • artist: ArtistItemid, title, thumbnail, channelId, playEndpoint, shuffleEndpoint, radioEndpoint
  • sections: List<ArtistSection> — e.g. “Songs”, “Albums”, “Singles”. Each section has title: String, items: List<YTItem>, and moreEndpoint: BrowseEndpoint? for loading the full list.
  • description: String? — the artist’s bio text from the immersive header.
  • subscriberCountText: String? — formatted subscriber count string (e.g. "12M subscribers"), if available.
  • monthlyListenerCount: String? — formatted monthly listener count string, if available.
val artistPage = YouTube.artist("UCxxxxxx").getOrThrow()
println("${artistPage.artist.title}")
artistPage.sections.forEach { section ->
    println("${section.title}: ${section.items.size} items")
}
The browseId for an artist always starts with UC (e.g. UCxxxxxx). You can obtain it from ArtistItem.id returned by search results or from Artist.id inside a SongItem.
To load all items in a section (when moreEndpoint is non-null), call YouTube.artistItems(endpoint) which returns Result<ArtistItemsPage>:
  • title: String
  • items: List<YTItem>
  • continuation: String?
Paginate with YouTube.artistItemsContinuation(continuation) which returns Result<ArtistItemsContinuationPage> (items, continuation).
val section = artistPage.sections.first { it.moreEndpoint != null }
var page = YouTube.artistItems(section.moreEndpoint!!).getOrThrow()
while (page.continuation != null) {
    page.items.forEach { println(it.title) }
    val contPage = YouTube.artistItemsContinuation(page.continuation!!).getOrThrow()
    page = ArtistItemsPage(
        title = page.title,
        items = contPage.items,
        continuation = contPage.continuation
    )
}

Album pages

YouTube.album(browseId, withSongs) returns Result<AlbumPage>. The AlbumPage data class contains:
  • album: AlbumItembrowseId, playlistId, title, artists, year, thumbnail, explicit
  • songs: List<SongItem> — full track listing (fetched via the album’s playlist ID, with automatic continuation handling)
  • description: String? — album description text
  • otherVersions: List<AlbumItem> — alternate versions (deluxe editions, remasters, etc.)
Set withSongs = false to skip the track fetch and get only metadata:
val albumPage = YouTube.album("MPREb_xxxxxx").getOrThrow()
println("${albumPage.album.title} (${albumPage.album.year})")
albumPage.songs.forEachIndexed { index, song ->
    println("${index + 1}. ${song.title}${song.duration}s")
}
if (albumPage.otherVersions.isNotEmpty()) {
    println("Other versions: ${albumPage.otherVersions.map { it.title }}")
}

Playlist pages

YouTube.playlist(playlistId) returns Result<PlaylistPage>. The PlaylistPage data class contains:
  • playlist: PlaylistItem — metadata including id, title, author, songCountText, thumbnail, playEndpoint, shuffleEndpoint, radioEndpoint, isEditable
  • songs: List<SongItem> — the first page of tracks; each SongItem includes a setVideoId field required for remove/reorder operations
  • songsContinuation: String? — token for the next songs page
  • continuation: String? — outer section-level continuation token
Fetch subsequent pages with YouTube.playlistContinuation(continuation) which returns Result<PlaylistContinuationPage> (songs, continuation):
val playlistPage = YouTube.playlist("PLxxxxxx").getOrThrow()
println("${playlistPage.playlist.title}${playlistPage.playlist.songCountText}")

var songs = playlistPage.songs.toMutableList()
var continuation = playlistPage.songsContinuation ?: playlistPage.continuation
while (continuation != null) {
    val next = YouTube.playlistContinuation(continuation).getOrThrow()
    songs += next.songs
    continuation = next.continuation
}
println("Total tracks loaded: ${songs.size}")
Private playlists throw an IllegalStateException with the message PLAYLIST_PRIVATE. Catch this if you are fetching playlists that may not be publicly accessible.

Generic browse

YouTube.browse(browseId, params) is a lower-level method for any InnerTube browse ID. It returns Result<BrowseResult>:
  • title: String? — the page title from the header
  • items: List<BrowseResult.Item> — each item has title: String? and items: List<YTItem>
BrowseResult exposes filterExplicit(enabled) and filterVideo(enabled) helpers.
val result = YouTube.browse("FEmusic_moods_and_genres_mood", params = "ggMPOg1uXzZCcDBtaEVFWTA%3D").getOrThrow()
result.items.forEach { group ->
    println("${group.title}: ${group.items.size} items")
}

Build docs developers (and LLMs) love