PHPackages                             music-companion/apple-music - 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. music-companion/apple-music

ActiveLibrary[API Development](/categories/api)

music-companion/apple-music
===========================

Apple Music SDK

5.0.0(2mo ago)129211MITPHPPHP ~8.4CI passing

Since Oct 27Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/musiccompanion/AppleMusic)[ Packagist](https://packagist.org/packages/music-companion/apple-music)[ Docs](http://github.com/MusicCompanion/AppleMusic)[ RSS](/packages/music-companion-apple-music/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (3)Dependencies (17)Versions (18)Used By (1)

Apple Music SDK (non official)
==============================

[](#apple-music-sdk-non-official)

[![Build Status](https://github.com/MusicCompanion/AppleMusic/workflows/CI/badge.svg?branch=master)](https://github.com/MusicCompanion/AppleMusic/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/2f53bbd58c82d8ee4cd84ee3d79469318884a1c5e24b6f726acbd4dc032c2fff/68747470733a2f2f636f6465636f762e696f2f67682f4d75736963436f6d70616e696f6e2f4170706c654d757369632f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/MusicCompanion/AppleMusic)[![Type Coverage](https://camo.githubusercontent.com/655838d1026d74f404070cd0802a1371e82c07b365ba0738797416f3fb5c48b0/68747470733a2f2f73686570686572642e6465762f6769746875622f4d75736963436f6d70616e696f6e2f4170706c654d757369632f636f7665726167652e737667)](https://shepherd.dev/github/MusicCompanion/AppleMusic)

This is a sdk to consume part of the Apple Music API.

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

[](#installation)

```
composer require music-companion/apple-music
```

Usage
-----

[](#usage)

```
use MusicCompanion\AppleMusic\{
    SDK,
    Key,
};
use Innmind\OperatingSystem\Factory;
use Innmind\TimeContinuum\Earth\Period\Hour;
use Innmind\Url\Path;
use Innmind\Filesystem\Name;
use Innmind\Immutable\Set;

$os = Factory::build();

$sdk = SDK::of(
    $os->clock(),
    $os->remote()->http(),
    Key::of( // @see https://help.apple.com/developer-account/#/devce5522674 to understand howto generate the key
        'KEY_ID',
        'TEAM_ID',
        $os
            ->filesystem()
            ->mount(Path::of('config_dir/'))
            ->get(new Name('AuthKey_TEAM_ID.p8'))
            ->match(
                static fn($file) => $file->content(),
                static fn() => throw new \RuntimeException('Key file not found'),
            ),
    ),
    new Hour(1) // expire the generated token after an hour
);

$sdk->storefronts()->all(); // Set
$catalog = $sdk->catalog(new SDK\Storefront\Id('fr'));
$result = $catalog->search('Pendulum Live at Brixton');
$albums = $result->albums()->map($catalog->album(...));

// @see https://developer.apple.com/documentation/applemusicapi/getting_keys_and_creating_tokens
// to retrieve the user token
$sdk->library($userToken)->match(
    static fn($libray) => $libray->artists(), // Set
    static fn() => throw new \RuntimeException('Invalid user token'),
);
```

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance86

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99.3% 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

Every ~193 days

Recently: every ~458 days

Total

13

Last Release

73d ago

Major Versions

1.1.0 → 2.0.02020-04-11

2.2.0 → 3.0.02022-07-24

3.1.0 → 4.0.02024-03-24

4.0.0 → 5.0.02026-03-01

PHP version history (6 changes)1.0.0PHP ~7.2

2.0.0PHP ~7.4

2.2.0PHP ~7.4|~8.0

3.0.0PHP ~8.1

3.1.0PHP ~8.2

5.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (141 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

sdkapplemusic

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/music-companion-apple-music/health.svg)

```
[![Health](https://phpackages.com/badges/music-companion-apple-music/health.svg)](https://phpackages.com/packages/music-companion-apple-music)
```

###  Alternatives

[aerni/laravel-spotify

A Laravel wrapper for the Spotify Web API

209145.6k](/packages/aerni-laravel-spotify)[dariusiii/php-itunes-api

Query iTunes API System

1116.9k](/packages/dariusiii-php-itunes-api)[appwilio/cdek-sdk

CDEK API SDK (cdek.ru)

406.5k](/packages/appwilio-cdek-sdk)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

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