getRecentlyPlayed

suspend fun getRecentlyPlayed(limit: Int? = api.spotifyApiOptions.defaultLimit, before: String? = null, after: String? = null): CursorBasedPagingObject<PlayHistory>(source)

Get tracks from the current user’s recently played tracks. Note: Currently doesn't support podcast episodes.

Requires the SpotifyScope.UserReadRecentlyPlayed scope

Api Reference

Parameters

limit

The number of objects to return. Default: 50 (or api limit). Minimum: 1. Maximum: 50.

before

The timestamp (retrieved via cursor) not including, but before which, tracks will have been played. This can be combined with limit

after

The timestamp (retrieved via cursor) not including, after which, the retrieval starts. This can be combined with limit