searchTrack

abstract suspend fun searchTrack(query: String, market: String? = null, limit: Int = 20, offset: Int = 0): SpotifyApiResponse<Tracks, ErrorBody>(source)

Search track API searches for a track from the given query. This is a paginated API.

offset is the page you are requesting for. Initially it will be 0.

You will have to increment it for subsequent pages.

You can know if there are more pages from Tracks.isNext.

See the Spotify Doc.

Return

Tracks when success and ErrorBody when error.

Parameters

query
market
limit
offset