PHP code example of audeio / spotify-web-api

1. Go to this page and download the library: Download audeio/spotify-web-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/ */

    

audeio / spotify-web-api example snippets


    $api = new \Audeio\Spotify\API();
    $api->setAccessToken('BAWSDOJWEO984yt34y35YgdsnhlreGERH56u45htrH54y');
    

    $api->getAlbum('id');
    $api->getAlbums(array('id-1', 'id-2', 'id-3'));
    $api->getAlbumTracks('id');
    $api->getArtist('id');
    $api->getArtists(array('id-1', 'id-2', 'id-3'));
    $api->getArtistAlbums('id', 'country');
    $api->getArtistRelatedArtists('id');
    $api->getTrack('id');
    $api->getTracks(array('id-1', 'id-2', 'id-3'));
    $api->getUserProfile('id');
    $api->getCurrentUser();
    $api->getUserPlaylist('userId', 'id');
    $api->getUserPlaylistTracks('userId', 'id');
    $api->getUserPlaylists('id');