Skip to content

truebluejw/apple-music-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Latest Unstable Version Build Status

Apple Music API PHP

This is a PHP wrapper for the Apple Music API.

Requirements

  • PHP 7.1 or later.
  • HTTP Client

HTTP Clients

This wrapper relies on HTTPlug, which defines how HTTP message should be sent and received. You can use any library to send HTTP messages that implements php-http/client-implementation.

Here is a list of all officially supported clients and adapters by HTTPlug: http://docs.php-http.org/en/latest/clients.html

Read more about HTTPlug in their docs.

Installation

Install it using Composer:

composer require pouler/apple-music-api

To install with Guzzle 6 you may run the following command:

$ composer require pouler/apple-music-api php-http/guzzle6-adapter php-http/message

Usage

Before using the Apple Music API, you need to sign up for the Apple Developer Programm. Read more about this here.

<?php

require 'vendor/autoload.php';

$jwtToken = PouleR\AppleMusicAPI\AppleMusicAPITokenGenerator::generateDeveloperToken(
    'team.id',
    'key.id',
    '/path/to/authkey.p8'
);

$client = new PouleR\AppleMusicAPI\APIClient();
$client->setDeveloperToken($jwtToken);

$api = new PouleR\AppleMusicAPI\AppleMusicAPI($client);

$result = $api->getCatalogPlaylist('nl', 'pl.a56541661a7a4cca95ddeca24e5e5316');

print_r($result);

About

PHP Wrapper for the Apple Music API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%