PHPackages                             noweh/php-soundcloud - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. noweh/php-soundcloud

ActiveLibrary[API Development](/categories/api)

noweh/php-soundcloud
====================

Soundcloud API Wrapper.

1.0.0(4y ago)51781[1 PRs](https://github.com/noweh/php-soundcloud/pulls)MITPHPPHP &gt;=7.3

Since Oct 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/noweh/php-soundcloud)[ Packagist](https://packagist.org/packages/noweh/php-soundcloud)[ RSS](/packages/noweh-php-soundcloud/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

SoundCloud API for PHP
======================

[](#soundcloud-api-for-php)

[![SoundCloud](https://camo.githubusercontent.com/38dce0988f7697c63a6efe30a74a8cb4577cf5476069c0338105e31830586538/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f7374796c653d666c61742d737175617265266d6573736167653d536f756e64436c6f756426636f6c6f723d464633333030266c6f676f3d536f756e64436c6f7564266c6f676f436f6c6f723d464646464646266c6162656c3d)](https://camo.githubusercontent.com/38dce0988f7697c63a6efe30a74a8cb4577cf5476069c0338105e31830586538/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f7374796c653d666c61742d737175617265266d6573736167653d536f756e64436c6f756426636f6c6f723d464633333030266c6f676f3d536f756e64436c6f7564266c6f676f436f6c6f723d464646464646266c6162656c3d)[![PHP](https://camo.githubusercontent.com/d932caa28b1dab8c681c5fbe3eb4cb6ad1facc101241b9efffe47698f774cb55/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d76372e332d3832386362372e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://camo.githubusercontent.com/d932caa28b1dab8c681c5fbe3eb4cb6ad1facc101241b9efffe47698f774cb55/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d76372e332d3832386362372e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)[![MIT Licensed](https://camo.githubusercontent.com/4092f960629f586fa1e249077e4d2c6678fe8e7a473d5c602866b34b9ef156d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6f7765682f7068702d736f756e64636c6f7564)](licence.md)[![last version](https://camo.githubusercontent.com/ccab975b8c45106307751ffca7668ad6a0b994c1bc4cfac4b1bd3d00889ded27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f7765682f7068702d736f756e64636c6f7564)](https://packagist.org/packages/noweh/php-soundcloud)

A PHP Wrapper for the SoundCloud REST API endpoints.

Installation
------------

[](#installation)

First, you need to add the component to your composer.json

```
composer require noweh/php-soundcloud

```

Update your packages with *composer update* or install with *composer install*.

Usage
-----

[](#usage)

For the calls to be valid, you must follow a few steps :

First, you have to create a new instance of the wrapper with the following parameters:

```
use Noweh\SoundcloudApi\Soundcloud;

$client = new SoundCloud(
    {CLIENT_ID},
    {CLIENT_SECRET},
    {CALLBACK_URL}
);

```

⚠️ Since [July 2021](https://developers.soundcloud.com/blog/security-updates-api), most calls to SoundCloud REST API requires an `access_token`.

⚠️ `{CALLBACK_URL}` must be the same as the one indicated in your SoundCloud account.

Second, you have to redirect the user to the SoundCloud login page:

```
...
header("Location: " . $client->getAuthorizeUrl('a_custom_param_to_retrieve_in_callback'));
exit();

```

On your callback URL, you can call GET/POST/PUT/DELETE methods. The `access_token` will be automatically generated with the `code` parameter present in this URL.

If you want to use API calls in another page, you have to set manually this data:

```
use Noweh\SoundcloudApi\Soundcloud;

$client = new SoundCloud(
    {CLIENT_ID},
    {CLIENT_SECRET},
    {CALLBACK_URL}
);

$client->setCode('3-134981-158678512-IwAXqypKWlDJCF');

// API Call
...

```

### Get Player Embed

[](#get-player-embed)

### This call does not require an access\_token.

[](#this-call-does-not-require-an-access_token)

To retrieve the widget embed code for any SoundCloud URL pointing to a user, set, or a playlist, do the following:

```
... // Create a new instance of client

// Required parameter
$url = 'https://soundcloud.com/......';

// Optional parameters
$maxheight = 180;
$sharing = true;
$liking = true;
$download = false;
$show_comments = true;
$show_playcount = false;
$show_user = false;

try {
    $response = $client->getPlayerEmbed($url, $maxheight, $sharing, $liking, $download, $show_comments, $show_playcount, $show_user)
} catch (Exception $e) {
    exit($e->getMessage());
}

```

### GET

[](#get)

```
... // Create a new instance of client

try {
    $response = $client->get('users/{CLIENT_ID}/tracks');
} catch (Exit $e) {
    exit($e->getMessage());
}

```

### POST

[](#post)

```
... // Create a new instance of client

try {
    $response = $client->post(
        'tracks/1/comments',
        [
            'body' => 'a new comment'
        ]
    );
} catch (Exception $e) {
    exit($e->getMessage());
}

```

### PUT

[](#put)

```
... // Create a new instance of client

try {
    $response = $client->put(
        'tracks/1',
        [
            'title' => 'my new title'
        ]
    );
} catch (Exception $e) {
    exit($e->getMessage());
}

```

### DELETE

[](#delete)

```
... // Create a new instance of client

try {
    $response = $client->delete('tracks/1');
} catch (Exception $e) {
    exit($e->getMessage());
}

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1664d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11422029?v=4)[Julien SCHMITT](/maintainers/Noweh)[@noweh](https://github.com/noweh)

---

Top Contributors

[![noweh](https://avatars.githubusercontent.com/u/11422029?v=4)](https://github.com/noweh "noweh (8 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

apiphpsoundcloudsoundcloud-apisoundcloud-playerphpapisoundcloud

### Embed Badge

![Health badge](/badges/noweh-php-soundcloud/health.svg)

```
[![Health](https://phpackages.com/badges/noweh-php-soundcloud/health.svg)](https://phpackages.com/packages/noweh-php-soundcloud)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
