PHP code example of mmoreram / spotify-api-bundle

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

    

mmoreram / spotify-api-bundle example snippets

bash
$ php composer.phar update
 php
return array(
    // ...
    new Mmoreram\SpotifyApiBundle\SpotifyApiBundle(),
    // ...
);
 php
$page = 1;

$artists = $this
    ->container
    ->get('spotify.api.search')
    ->findArtist('Hans Zimmer', $page);
 php
$artists = $this
    ->container
    ->get('spotify.api.search')
    ->findFirstArtist('Hans Zimmer');
 php
$page = 1;

$albums = $this
    ->container
    ->get('spotify.api.search')
    ->findAlbums("Pirate of the Caribbean, at world's end", $page);
 php
$albums = $this
    ->container
    ->get('spotify.api.search')
    ->findFirstAlbum("Pirate of the Caribbean, at world's end");
 php
$page = 1;

$tracks = $this
    ->container
    ->get('spotify.api.search')
    ->findTracks("I don't think now is the best time", $page);
 php
$tracks = $this
    ->container
    ->get('spotify.api.search')
    ->findFirstTrack("I don't think now is the best time");
 php
$artist = $this
    ->container
    ->get('spotify.api.search')
    ->getArtist('spotify:artist:0YC192cP3KPCRWx8zr8MfZ');
 php
$album = $this
    ->container
    ->get('spotify.api.search')
    ->getAlbum('spotify:album:6JoI0NEAqeJ20X6lU3Drx0');
 php
$track = $this
    ->container
    ->get('spotify.api.search')
    ->getTrack('spotify:track:5sbwYsgzeg7wsug1A1pTiO');