itisbean/php-spotify-api

spotify api for php

1.0.2 2021-01-18 11:38 UTC

This package is auto-updated.

Last update: 2024-11-18 20:10:04 UTC


README

spotify api for php

Composer Install

composer require itisbean/php-spotify-api

Use

// 引入autoload.php(框架中使用不需要)
include_once __DIR__.'/../vendor/autoload.php';
// 实例化Api类
$api = new \spotifyMusic\Api();
// 调用
$ret = $api->getSingerInfo('2zzKlxMsKTPMsZacZCPRNA');

Function

Get singer information

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

Get all albums of the singer

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

Get album information

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

Get album songs

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

Get the playlist list

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