Install
composer require sonrac/yandex-music-api
or add to your composer.json
to require
section
{
"sonrac/yandex-music-api": "1.0"
}
- Create instance
use sonrac\YandexMusic\Yandex;
$api = new Yandex('username', 'password');
- Create instance with proxy. Proxy getting from gimmeProxy
use sonrac\YandexMusic\Yandex;
$api = new Yandex('username', 'password', true);
- Get account status
$accountStatus = $api->getAccountStatus();
- Get feed
$feed = $api->getFeed();
- Get genres
$genres = $api->getGenres();
- Search
$searchResult = $api->search('text', 0);
- Get user play lists
// For current user
$playLists = $api->getUserPlayLists();
// For some user with uid 1000
$playLists = $api->getUserPlayLists(1000);
* Get play list
```php
$playlist = $api->getPlayList(100);
- Get play lists
$playlists = $api->getPlayLists([1003, 1010]);
- Get play lists
$playlists = $api->getPlayLists([1003, 1010]);
- Remove play list
$resultRemove = $api->removePlaylist(1003);
- Rename play list
$resultRename = $api->renamePlaylist(1003, 'new playlist');
- Add tracks to play list
$resultRename = $api->addTrackToPlaylist(1003, [1,2,3,4]);
- Remove tracks from play list
$resultRename = $api->removeTracksFromPlaylist(1003, [1,2,3,4]);