1. Go to this page and download the library: Download edwindayot/echonest 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/ */
edwindayot / echonest example snippets
use Echonest\Facade\Echonest;
$echonest = Echonest::init('YOUR_API_KEY');
use Echonest\Facade\EchonestArtists;
$artists = new EchonestArtists($echonest);
use Echonest\Facade\EchonestSongs;
$songs->getArtistSongs($name);
$songs->searchSongs($title);
$songs->getSongProfile($id);
use Echonest\Facade\EchonestGenres;
$genres->getArtists($name);
$genres->getList();
$genres->getProfile($name);
$genres->getSearch($name);
$genres->getSimilar($name);
use Echonest\Facade\EchonestTracks;
$tracks->getTrackProfile($id);
$tracks->getUploadTrack($url);
$tracks->postUploadTrack($url);
$echonest->queryBuilder
->setApi('category_name')
->setCommand('method_name')
->setName('a name') // alias for setOption('name', 'a name')
->setId('anID') // alias for setOption('id', 'anID')
->setBucket('a_bucket') // alias for setOption('bucket', 'a_bucket')
->sortBy('a_sort_option', 'desc') // alias for setOption('sort', 'a_sort_option-desc')
->setOption('option_name', 'value')
->limit(3) // get 3 elements (0, 1, 2)
->limit(3, 2) // get 3 elements starting from 3rd base element (2, 3, 4)
->get();
$artists->get()
->has('artists') // return bool
->orderBy('name')
->toArray(); // return the array transformed values of $items