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 is a Kotlin Multiplatform library that wraps YouTube Music’s internal InnerTube API, giving Android and KMP developers a clean, coroutine-based interface for building music applications. Whether you’re building a full-featured music player, a playlist manager, or a discovery app, Inner takes care of the raw HTTP communication, response parsing, and authentication plumbing so you can focus on your product.

What Inner provides

Search

Search YouTube Music for songs, videos, albums, artists, and playlists. Filter results by type and page through them with continuation tokens.

Browse

Browse the home feed, explore page, charts, moods & genres, new releases, and artist/album detail pages.

Playback

Fetch player responses, stream URLs, and up-next queues. Resolve PoTokens for authenticated and anonymous playback across multiple YouTube clients.

Playlists & Library

Create, rename, delete, and manage playlist entries. Page through playlist songs using continuation tokens. Access listening history and liked content.

Authentication

Authenticate with a YouTube Music session cookie. Manage visitor data, dataSyncId, and PoToken state through the PlaybackAuthState model.

KMP Support

Share browse and search logic across Android and iOS targets from a single commonMain source set, with platform-specific HTTP engines wired in automatically.

Project structure

Inner exposes two public entry points depending on your target platform: YouTube (Android singleton) YouTube is a Kotlin object defined in androidMain. It owns an internal InnerTube instance and a MutableStateFlow<PlaybackAuthState> that centralises all authentication state — cookie, visitor data, dataSyncId, and PoToken values. Because it is a singleton you never instantiate it; you simply set properties and call suspend functions:
// androidMain
YouTube.locale = YouTubeLocale(gl = "US", hl = "en-US")
YouTube.cookie = "SAPISID=...; ..."

val result = YouTube.search("Daft Punk", YouTube.SearchFilter.FILTER_SONG)
Use YouTube whenever your project targets Android exclusively or you are writing platform-specific Android code inside a KMP module. PortableInnertube (KMP class) PortableInnertube is a regular class defined in commonMain. It accepts an optional HttpClient in its constructor, making it straightforward to inject in tests or share across targets. It covers search (with an optional raw params filter string), browse, home feed, albums, artists, and playlists — the full set of operations that work without Android-specific dependencies:
// commonMain
val innertube = PortableInnertube(
    locale = YouTubeLocale(gl = "US", hl = "en-US")
)
innertube.cookie = "SAPISID=...; ..."

val result = innertube.search("Daft Punk")
Note that PortableInnertube.search() accepts an optional params string rather than a typed SearchFilter. Android-specific features such as stream URL extraction, PoToken generation, and playback tracking are only available through the YouTube singleton. Use PortableInnertube when you want to share music-fetching logic between Android and iOS in a KMP project, or when you need to inject a custom HTTP client.

Platform support

Inner is built with the Kotlin Multiplatform Gradle plugin and targets the following platforms:
PlatformTargetNotes
AndroidandroidminSdk 26, compileSdk 36, JVM target 21
iOS (device)iosArm64arm64 physical devices
iOS (simulator, Apple Silicon)iosSimulatorArm64M-series Mac simulators
iOS (simulator, Intel)iosX64x86-64 Mac simulators
The android {} block in build.gradle.kts sets namespace = "com.tamed.music.innertube" and jvmToolchain(21) is applied at the top-level kotlin {} block, so all source sets compile to JVM 21 bytecode on Android and use Kotlin/Native for iOS.

Key dependencies

DependencyRole
ktor-client-coreMultiplatform HTTP client (commonMain)
ktor-client-content-negotiation + ktor-serialization-kotlinx-jsonJSON response deserialisation (commonMain)
ktor-client-encodingGzip/deflate content-encoding plugin (commonMain)
ktor-client-okhttpOkHttp engine for Android
ktor-client-darwinURLSession-backed engine for iOS
brotliBrotli decompression for Android HTTP responses
newpipe-extractorStream URL extraction and signature deciphering (Android)
re2jRE2-compatible regex for stream processing (Android)
rhinoJavaScript engine used to generate PoTokens on Android
Inner operates against YouTube Music’s internal youtubei/v1/ API endpoint (https://music.youtube.com/youtubei/v1/). No official API key is required, but authenticated features — such as library access, playlist management, history, and account info — need a valid YouTube Music session cookie.

Build docs developers (and LLMs) love