Skip to content

stevesoltys/apple-music

Repository files navigation

Apple Music

Build Status

An Apple Music API wrapper.

Installation

repositories {
    jcenter()
    maven { url 'https://jitpack.io' }
}

dependencies {
    compile 'com.github.stevesoltys:apple-music:0.1.0'
}

Usage

Create an AppleMusic instance with your credentials, and run an API query.

Here's an example:

val appleMusic = AppleMusic(
    teamId = "A93J3NMCK2",
    privateKey = Files.readAllBytes(Path.of("private.key")),
    keyId = "S019516J93",
    storefront = "us"
)

val searchResultArtist = appleMusic.search(
    "j cole", types = setOf(SearchResultType.ARTISTS)
).results?.artists?.data?.first()

val artistAlbums = appleMusic.getAllAlbumsByArtistId(searchResultArtist!!.id!!)

// ...

License

This library is available as open source under the terms of the MIT License.