Skip to content

Service Artists

Kiril Kirkov edited this page Apr 30, 2020 · 3 revisions

Make Instance

$spotifyWebApi = new SpotifyWebApi([
        'clientId' => 'SPOTIFY_CLIENT_ID',
        'clientSecret' => 'SPOTIFY_CLIENT_SECRET',
        'accessToken' => 'ACCESS_TOKEN',
        'refreshToken' => 'SPOTIFY_API_REFRESH_TOKEN',
]);

Do requests

Get an Artist

equal to - https://developer.spotify.com/documentation/web-api/reference/artists/get-artist/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::artists()::getArtist('4k1ELeJKT1ISyDv8JivPpB')
)->getResult();

Get an Artist's Albums

equal to - https://developer.spotify.com/documentation/web-api/reference/artists/get-artists-albums/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::artists()::getArtistAlbums('4k1ELeJKT1ISyDv8JivPpB')
)->getResult();

Get Artist's Top Tracks

equal to - https://developer.spotify.com/documentation/web-api/reference/artists/get-artists-top-tracks/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::artists()::getArtistTopTracks('4k1ELeJKT1ISyDv8JivPpB')
)->getResult();

Get Artist Realeated Artists

equal to - https://developer.spotify.com/documentation/web-api/reference/artists/get-related-artists/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::artists()::getArtistRelatedArtists('4k1ELeJKT1ISyDv8JivPpB')
)->getResult();

Get Several Artists

equal to - https://developer.spotify.com/documentation/web-api/reference/artists/get-several-artists/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::artists()::getArtists(['4k1ELeJKT1ISyDv8JivPpB', '5eKLa1xyHLq8ERWmT1CRHj'])
)->getResult();