PHPackages                             danae/soundcloud-php - 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. danae/soundcloud-php

AbandonedArchivedLibrary[API Development](/categories/api)

danae/soundcloud-php
====================

Easy to use SoundCloud API wrapper for PHP

3.0.1(4y ago)4911[4 issues](https://github.com/danae/soundcloud-php/issues)GPL-3.0-or-laterPHPPHP ^7.4||^8.0

Since Jul 20Pushed 4y agoCompare

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

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

soundcloud-php
==============

[](#soundcloud-php)

**soundcloud-php** is a SoundCloud® API wrapper for PHP 7.4 or higher.

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

[](#installation)

The SoundCloud library is best installed using Composer:

```
$ composer require danae/soundcloud-php
```

Alternatively include the following line in the require block in composer.json:

```
"require": {
  "danae/soundcloud-php": "^3.0"
}
```

Usage
-----

[](#usage)

The following is a usage example of the library:

```
require("vendor/autoload.php");

// Create the client
$soundcloud = new Danae\Soundcloud\Soundcloud([
  'client_id' => '',
  'client_secret' => '',
  'redirect_url' => ''
]);

// Authorize the client with an authorization code
$soundcloud->authorizeWithCode('');

// Get the tracks of the authenticated user
$tracks = $soundcloud->get('/me/tracks');
```

To use the library, you must create an instance of the `Danae\SoundCloud\Soundcoud` class and provide your client\_id and client\_secret to the constructor:

```
$soundcloud = new Danae\Soundcloud\Soundcloud([
  'client_id' => '',
  'client_secret' => ''
]);
```

### Authorization

[](#authorization)

To use the client you must authenticate it first. The client has support for the `auth_code`, `client_credentials` and `refresh_token` grants provided by the SoundCloud API. You can use one of the following methods to authenticate the client:

```
// Using an authorization code
$soundcloud->authorizeWithCode('');

// Using client credentials provided via the constructor
$soundcloud->authorizeWithClientCredentials();

// Using a refresh token
$soundcloud->authorizeWithRefreshToken('');
```

Upon succesful authorization, the access token will be automatically added to requests to the client, but can also be obtained via the client instance.

```
$accessToken = $soundcloud->accessToken;
```

#### Authorize using an authorization code

[](#authorize-using-an-authorization-code)

Provide at least the `client_id`, `client_secret` and `redirect_uri` keys to the constructor of the client. Then call the `authorizeWithCode` method.

```
$soundcloud = new Danae\Soundcloud\Soundcloud([
  'client_id' => '',
  'client_secret' => '',
  'redirect_url' => ''
]);

$soundcloud->authorizeWithCode('');
```

#### Authorize using client credentials

[](#authorize-using-client-credentials)

Provide at least the `client_id` and `client_secret` keys to the constructor of the client. Then call the `authorizeWithClientCredentials` method.

```
$soundcloud = new Danae\Soundcloud\Soundcloud([
  'client_id' => '',
  'client_secret' => ''
]);

$soundcloud->authorizeWithClientCredentials();
```

#### Authorize using a refresh token

[](#authorize-using-a-refresh-token)

```
$soundcloud = new Danae\Soundcloud\Soundcloud([
  'client_id' => '',
  'client_secret' => '',
  'redirect_url' => ''
]);

$soundcloud->authorizeWithRefreshToken('');
```

### Making requests

[](#making-requests)

When the client is authorized, you can use the following methods to make requests to the SoundCloud API and receive a `stdClass` object created by `json_decode`ing the response body. All request functions throw a `Runtimexception` with the status code if the request failed.

```
// Send a request to one of the API endpoints
$soundcloud->get($uri, array $query = []);
$soundcloud->post($uri, array $body = [], array $query = []);
$soundcloud->put($uri, array $body[], array $query = []);
$soundcloud->delete($uri, array $query = []);

// Resolve a SoundCloud URL to an API endpoint
$soundcloud->resolve($url, array $query = []);

// Send an oembed request to the API
$soundcloud->oembed($url, array $query = []);
```

For more information on the API itself, please refer to the [SoundCloud API explorer](https://developers.soundcloud.com/docs/api/explorer/open-api) or the [accompanying guide](https://developers.soundcloud.com/docs/api/guide).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Every ~197 days

Total

4

Last Release

1535d ago

Major Versions

2.0.1 → 3.02021-08-02

PHP version history (3 changes)2.0PHP ^7.2

3.0PHP ^7.4

3.0.1PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f9feb2295e6139e81aef5c3d20fa00a79578e2166f1ca40bc636f0217ecc46f?d=identicon)[danae-php](/maintainers/danae-php)

---

Tags

phpapiwrappersoundcloud

### Embed Badge

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

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

###  Alternatives

[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[jayzeng/virustotalapi

VirusTotal Public API v2.0 PHP Wrapper

62140.7k3](/packages/jayzeng-virustotalapi)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)

PHPackages © 2026

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