A simple wrapper for VK Music API.
For use this library, first you need get a token and user-agent.
See for more
vodka2/vk-audio-token.
composer require chipslays/vk-musicuse Chipslays\VkMusic\Client;
$client = new Client('YOUR_TOKEN', 'YOUR_USERAGENT');
$response = $client->search('Justin Bieber - Baby');
print_r($response->toArray());
// Array
// (
// [count] => 3693
// [items] => Array
// (
// [0] => ...
// [1] => ...
// [2] => ...
// )
// )You can get the value using dot notation by chipslays/collection.
print_r($response->get('items.0.artist'));NOTICE: Optional parameter
$extrais a array of parameters withkey => value.
$client->search('Justin Bieber - Baby');$client->getById(['371745461_456289486', '-41489995_202246189']);$client->get('371745461');$client->getPlaylists('371745461');$client->getRecommendations();$client->getPopular();$client->method('audio.search', [
'q' => 'Justin Bieber - Baby',
'count' => '10',
]);You can use vk_music helper instead Client class.
$client = vk_music('YOUR_TOKEN', 'YOUR_USERAGENT');- Write tests 😴💤
MIT