PHP code example of stounhandj / yandex-music-api
1. Go to this page and download the library: Download stounhandj/yandex-music-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/ */
stounhandj / yandex-music-api example snippets
use StounhandJ\YandexMusicApi\Client;
$token = "AQAAAAANDd5rMAG1XnIKIEVVMGV4ibf8kw3FeA1";
$client = new Client($token);
foreach ($client->getLikesTracks() as $track){
echo $track->title;
}
use StounhandJ\YandexMusicApi\Client;
$token = "AQAAAAANDd5rMAG1XnIKIEVVMGV4ibf8kw3FeA1";
$client = new Client($token);
$likesAlbum = $client->getLikesAlbums()[0];
$firstTrack = $likesAlbum->getTracks()[0];
$result = $firstTrack->downloadTrack("test.mp3");