SearchApi

Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. It is possible to have 0 results and no exception thrown with these methods. Check the size of items returned.

Api Reference

Constructors

Link copied to clipboard
constructor(api: GenericSpotifyApi)

Types

Link copied to clipboard

Describes which object to search for

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun search(query: String, vararg searchTypes: SearchApi.SearchType, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null, includeExternal: Boolean? = null, language: Language? = null): SpotifySearchResult

Get Spotify Catalog information about artists, albums, tracks and/or playlists that match a keyword string.

Link copied to clipboard
suspend fun searchAlbum(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null, language: Language? = null): PagingObject<SimpleAlbum>

Get Spotify Catalog information about albums that match the keyword string. See SearchApi.search for more information

Link copied to clipboard
suspend fun searchAllTypes(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market, language: Language? = null): SpotifySearchResult

Get Spotify Catalog information about any searchable type that match the keyword string. See SearchApi.search for more information

Link copied to clipboard
suspend fun searchArtist(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null, language: Language? = null): PagingObject<Artist>

Get Spotify Catalog information about artists that match the keyword string. See SearchApi.search for more information

Link copied to clipboard
suspend fun searchEpisode(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market, language: Language? = null): PagingObject<SimpleEpisode>

Get Spotify Catalog information about episodes that match the keyword string. See SearchApi.search for more information

Link copied to clipboard
suspend fun searchPlaylist(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null, language: Language? = null): PagingObject<SimplePlaylist>

Get Spotify Catalog information about playlists that match the keyword string. See SearchApi.search for more information

Link copied to clipboard
suspend fun searchShow(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market, language: Language? = null): PagingObject<SimpleShow>

Get Spotify Catalog information about shows that match the keyword string. See SearchApi.search for more information

Link copied to clipboard
suspend fun searchTrack(query: String, filters: List<SearchFilter> = listOf(), limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null, language: Language? = null): PagingObject<Track>

Get Spotify Catalog information about tracks that match the keyword string. See SearchApi.search for more information