InnerTube is a Kotlin Android library that wraps YouTube’s internal InnerTube API, giving your app structured, type-safe access to YouTube Music data — no scraping, no unofficial REST wrappers, just direct communication with the same endpoints the YouTube Music web app uses.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.
InnerTube targets Android API 26+ and is built on Kotlin coroutines. Every
YouTube method is a suspend function and must be called from a coroutine scope.What InnerTube Does
InnerTube exposes a singleYouTube singleton with suspend functions covering the full breadth of YouTube Music functionality:
| Capability | Key Methods |
|---|---|
| Search | search(), searchSummary(), searchSuggestions(), searchContinuation() |
| Playback | player(), next(), queue(), registerPlayback(), newPipePlayer() |
| Browse | home(), explore(), browse(), moodAndGenres(), newReleaseAlbums() |
| Artist & Album | artist(), artistItems(), album(), albumSongs() |
| Playlists | playlist(), createPlaylist(), renamePlaylist(), deletePlaylist(), addToPlaylist(), removeFromPlaylist(), moveSongPlaylist() |
| User Library | library(), libraryRecentActivity(), musicHistory() |
| Engagement | likeVideo(), likePlaylist(), subscribeChannel(), feedback() |
| Comments | comments(), commentContinuation(), commentReplies() |
| Bot Mitigation | refreshVisitorData(), PoToken support via player() |
| Lyrics & Transcript | lyrics(), transcript() |
| Charts | getChartsPage() |
| Account | accountInfo() |
Architecture Overview
YouTube is the only class you interact with. It owns an InnerTube instance and forwards configuration properties to it. After receiving raw JSON from InnerTube, YouTube methods delegate parsing to page-level helpers (SearchPage, ArtistPage, AlbumPage, etc.) that convert JSON renderer trees into typed Kotlin data classes such as SongItem, ArtistItem, AlbumItem, and PlaylistItem.
InnerTube handles all HTTP concerns: building the Ktor/OkHttp client, attaching the correct X-YouTube-Client-* headers, managing cookies and SAPISIDHASH authorization, applying proxy and IP version configuration, and retrying transient network failures with exponential backoff.
YouTubeExtractor is a standalone Rhino-based deobfuscator that resolves YouTube’s signature cipher and n parameter throttling transforms directly from the player base JS — no WebView required.
Requirements
| Requirement | Value |
|---|---|
| Min Android SDK | API 26 (Android 8.0 Oreo) |
| Compile SDK | 37 |
| Kotlin | Coroutines required |
| Java Toolchain | 21 |
| Core Library Desugaring | Enabled |
Dependencies
InnerTube pulls in the following libraries (declared inbuild.gradle.kts):
| Library | Role |
|---|---|
ktor-client-core + ktor-client-okhttp | HTTP engine for all InnerTube requests |
ktor-client-content-negotiation + ktor-serialization-json | JSON (de)serialization via kotlinx.serialization |
ktor-client-encoding + brotli | Brotli/gzip response decompression |
newpipeextractor | Fallback stream URL extraction via NewPipeExtractor |
rhino | JavaScript engine for YouTube signature/throttling deobfuscation |
Get Started
Quickstart
Add InnerTube to your project and make your first API call in under 5 minutes.
Configuration
Configure locale, authentication, proxy settings, and IP version filtering.
The YouTube Object
Explore the full surface area of the YouTube singleton and its suspend functions.
Search API
Search for songs, videos, albums, artists, and playlists with type-safe filters.