PHP code example of itisbean / php-spotify-api

1. Go to this page and download the library: Download itisbean/php-spotify-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itisbean / php-spotify-api example snippets


composer 

// 引入autoload.php(框架中使用不需要)
// 调用
$ret = $api->getSingerInfo('2zzKlxMsKTPMsZacZCPRNA');

/**
 * 獲取歌手信息
 * @param string $singerId
 * @return array
 */
$api->getSingerInfo('2zzKlxMsKTPMsZacZCPRNA');

/**
 * 獲取歌手全部專輯
 * @param string $singerId
 * @return array
 */
$api->getSingerAlbums('2zzKlxMsKTPMsZacZCPRNA');

/**
 * 獲取專輯信息
 * @param string $albumId
 * @return array
 */
$api->getAlbumInfo('0zPpdDiDX6JnGZRHXFYuZt');

/**
 * 獲取專輯歌曲
 * @param string $albumId
 * @return array
 */
$api->getAlbumSongs('0zPpdDiDX6JnGZRHXFYuZt');

/**
 * 獲取歌單列表
 * @param string $playlistId
 * @return array
 */
$api->getPlaylist('37i9dQZEVXbLwpL8TjsxOG');