Skip to content

Playlists API

Romain Monteil edited this page Jan 3, 2019 · 1 revision

Playlists API

Get a playlist

$response = $spotify->playlists()->get('3cEYpjA9oz9GiPac4AsH4n', [
    QueryParametersInterface::PARAMETER_MARKET => 'FR'
]);

Return an instance of PlaylistResponse

Get a list of current user's playlists

$response = $spotify->playlists()->me([
    QueryParametersInterface::PARAMETER_LIMIT => 10,
    QueryParametersInterface::PARAMETER_OFFSET => 5,
]);

Return an instance of PagingResponse

Get a list of a user's playlists

$response = $spotify->playlists()->user([
    QueryParametersInterface::PARAMETER_IDS => [
        '382ObEPsp2rxGrnsizN5TX',
        '1A2GTWGtFfWp7KSQTwWOyo',
    ],
    QueryParametersInterface::PARAMETER_MARKET => 'FR',
]);

Return an instance of AlbumsResponse

Get a playlist's tracks

$response = $spotify->playlists()->tracks('37i9dQZF1DWVFJtzvDHN4L', [
    QueryParametersInterface::PARAMETER_MARKET => 'FR',
    QueryParametersInterface::PARAMETER_LIMIT => 1,
    QueryParametersInterface::PARAMETER_OFFSET => 0,
]);

Return an instance of PagingResponse