Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 833 Bytes

fetching-album-information.md

File metadata and controls

36 lines (25 loc) · 833 Bytes

Fetching Information About Albums

There are a few methods for retrieving information about one or more albums from the Spotify catalog. For example, info about a albums's artist or all the tracks on an album.

Getting info about a single album

$album = $api->getAlbum('ALBUM_ID');

echo '<b>' . $album->name . '</b>';

Getting info about multiple albums

$albums = $api->getAlbums([
    'ALBUM_ID',
    'ALBUM_ID',
]);

foreach ($albums->albums as $album) {
    echo '<b>' . $album->name . '</b> <br>';
}

Getting all tracks on an album

$tracks = $api->getAlbumTracks('ALBUM_ID');

foreach ($tracks->items as $track) {
    echo '<b>' . $track->name . '</b> <br>';
}

Please see the method reference for more available options for each method.