VK Audio API reference for VK Audio Token
Index
API Methods
General info
New API Methods

audio.getRecommendations

Get suggested audios

Parameters:

NameValue
user_id (optional)User id for which similar audios will be returned
target_audio (optional)Audio (owner and id) for which similar audios will be returned, if not specified, then recommendations for the specified user will be returned
count (optional)Maximum number of audios to return
offset (optional)Offset to skip that number of audios

Example (Kate):

$targetAudio = "371745461_456289486";
curl_setopt(
$ch,
CURLOPT_URL,
"https://api.vk.com/method/audio.getRecommendations?access_token=".TOKEN.
"&target_audio=$targetAudio&count=10&offset=20&v=5.95"
);
<?php
include __DIR__.'/../../autoloader.php';
use Vodka2\VKAudioToken\SupportedClients;
//Token obtained by example_microg.php script
define('TOKEN', $argv[1]);
define('USER_AGENT', SupportedClients::Kate()->getUserAgent());
$ch = curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER, array('User-Agent: '.USER_AGENT));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$targetAudio = "371745461_456289486";
curl_setopt(
$ch,
CURLOPT_URL,
"https://api.vk.com/method/audio.getRecommendations?access_token=".TOKEN.
"&target_audio=$targetAudio&count=10&offset=20&v=5.95"
);
echo json_encode(json_decode(curl_exec($ch)), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n\n";