PHP code example of chipslays / soundcloud

1. Go to this page and download the library: Download chipslays/soundcloud 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/ */

    

chipslays / soundcloud example snippets

 

 

use Soundcloud\Api;

ID_HERE');

$response = $sc->api(['resolve'], [
    'url' => 'https://soundcloud.com/uvulauvula/sets/snova-vozvrashchayus-domoy-f-pasosh',
]);

$response = $sc->api(['tracks'], [
    'q' => 'платина бандана',
]);

$trackId = $sc->getTrackId('https://soundcloud.com/molchat-doma/discoteque');

$trackId = $sc->getTrackId('https://soundcloud.com/pureflavoor/skriptonit-polozhenie-pureflavor-remix');
$streams = $sc->api(['i1', 'tracks', $trackId, 'streams']);

// or you can use short alias for this:
$streams = $sc->getStreamByTrackUrl('https://soundcloud.com/pureflavoor/skriptonit-polozhenie-pureflavor-remix');

$playlist = $sc->getPlaylist('https://soundcloud.com/uvulauvula/sets/snova-vozvrashchayus-domoy-f-pasosh');

$playlist = $sc->getPlaylist('https://soundcloud.com/uvulauvula/sets/snova-vozvrashchayus-domoy-f-pasosh');
$m3u = $sc->playlistToM3U($playlist);
file_put_contents(__DIR__.'/playlist.m3u', $m3u);