The InnerTube SDK exposes three distinct entry points for searching YouTube Music content: a typed filtered search that returns a flat list of items, a summary search that groups results by content category, and a suggestions endpoint that powers autocomplete. All three are suspend functions on theDocumentation 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.
YouTube singleton and return Result-wrapped types so you can handle failures with runCatching or fold.
Overview
YouTube.search()
Returns a typed, paginated
SearchResult for a specific content category using a SearchFilter constant.YouTube.searchSummary()
Returns a
SearchSummaryPage with results bucketed into labelled sections — songs, videos, albums, artists, and more.YouTube.searchSuggestions()
Returns autocomplete query strings and recommended
YTItem objects as the user types.Basic search with a filter
YouTube.search(query, filter) sends a query to the InnerTube /search endpoint scoped to a specific content type. It returns Result<SearchResult>, where SearchResult carries a List<YTItem> and an optional continuation token for paging.
Available SearchFilter constants
| Constant | Content type |
|---|---|
SearchFilter.FILTER_SONG | Audio tracks |
SearchFilter.FILTER_VIDEO | Music videos |
SearchFilter.FILTER_ALBUM | Albums and EPs |
SearchFilter.FILTER_ARTIST | Artist channels |
SearchFilter.FILTER_FEATURED_PLAYLIST | YouTube Music editorial playlists |
SearchFilter.FILTER_COMMUNITY_PLAYLIST | User-created playlists |
SearchFilter.FILTER_PODCAST | Podcast shows |
SearchFilter.FILTER_EPISODE | Individual podcast episodes |
SearchFilter.FILTER_PROFILE | User profiles |
Search summary
YouTube.searchSummary(query) performs an unfiltered search and automatically groups the results into labelled SearchSummary sections. The sections are sorted in a fixed order: Top result → Songs → Videos → Albums → Artists → Playlists → Podcasts → Episodes → Profiles. This is the right call when building a “top results” view.
SearchSummaryPage merges sections with identical titles that appear in separate shelf renderers before sorting, so duplicate section headers are deduplicated automatically.Pagination with continuation tokens
Bothsearch() and searchSummary() can return more results than fit in a single response. When SearchResult.continuation is non-null, pass it to YouTube.searchContinuation() to fetch the next page. Keep paging until continuation is null or the returned items list is empty.
Search suggestions
YouTube.searchSuggestions(query) returns a SearchSuggestions object with two fields:
queries: List<String>— autocomplete query strings to show in a dropdownrecommendedItems: List<YTItem>— fully-formedYTItemobjects (typically songs or artists) recommended by YouTube Music
Filtering results in-memory
Once you have aList<YTItem>, two extension functions defined on YTItem let you apply additional client-side filters before presenting results to the user.
filterExplicit(enabled)
Removes items whose explicit flag is true. Pass enabled = false to keep the list unchanged (useful for toggling off a parental-controls setting without branching your UI code).
filterVideoSongs(disableVideos)
Removes SongItem entries whose isVideoSong property is true (i.e. items with a non-ATV musicVideoType). Pass disableVideos = false to keep music videos in the list.
Complete example
Full search flow with filter, continuation, and suggestions
Full search flow with filter, continuation, and suggestions