1. Go to this page and download the library: Download rennokki/larafy 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/ */
use Rennokki\Larafy\Larafy;
$api = new Larafy('your_app_id_here', 'your_app_secret_here');
try {
$api->searchArtists('Lana del Rey');
} catch(\Rennokki\Larafy\Exceptions\SpotifyAuthorizationException $e) {
// invalid ID & Secret provided
$e->getAPIResponse(); // Get the JSON API response.
}
try {
$api->searchArtists('Lana del Rey', -30, -40);
} catch(\Rennokki\Larafy\Exceptions\SpotifyAPIException $e) {
// invalid data sent
$e->getAPIResponse(); // Get the JSON API response.
}
// Search for albums.
$api->searchAlbums('Master of Puppets', $limit, $offset);
// Get an album using ID.
$api->getAlbum('album_id');
// Get more albums at once based on IDs.
$api->getAlbums(['id1', 'id2', ...]);
$api->getAlbums('id1,id2,...');
// Get album's tracks.
$api->getAlbumTracks('album_id', $limit, $offset);
// Search for tracks.
$api->searchTracks('Fade to Black', $limit, $offset);
// Get a track using ID.
$api->getTrack('track_id');
// Get more tracks at once based on IDs.
$api->getTracks(['id1', 'id2', ...]);
$api->getTracks('id1,id2,...');
// Search for artists.
$api->searchArtists('Metallica', $limit, $offset);
// Get an artist using ID.
$api->getArtist('artist_id');
// Get more artists at once based on IDs.
$api->getArtists(['id1', 'id2', ...]);
$api->getArtists('id1,id2,...');
// Get artist's albums.
$api->getArtistAlbums('artist_id', $limit, $offset, ['single', 'appears_on']);
// Get artist's top tracks.
$api->getArtistTopTracks('artist_id');
// Get artist's related artists.
$api->getArtistRelatedArtists('artist_id');
// Search for playlists.
$api->searchPlaylists('This Is Metallica', $limit, $offset);
// Get a playlist using ID.
$api->getPlaylist('playlist_id');
// Get playlist's albums.
$api->getPlaylistTracks('playlist_id', $limit, $offset);
// Get featured playlists from a specific time.
$api->getFeaturedPlaylists(Carbon::now(), $limit, $offset);
$api->getFeaturedPlaylists('2018-05-19 00:00:00', $limit, $offset);
// Get genre seeds.
$api->getGenreSeeds();
// Get all the Browse categories.
$api->getBrowseCategories($limit, $offset);
// Get details about one of the Browse's category.
$api->getBrowseCategory('mood');
// Get playlists from a Browse category.
$api->getCategoryPlaylists('mood', $limit, $offset);
// Get new albums releases.
$api->getNewReleases($limit, $offset);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.