Skip to content

stevesoltys/apple-music

Folders and files

NameName
Last commit message
Last commit date
Dec 14, 2022
Dec 14, 2022
Dec 14, 2022
Aug 28, 2020
Aug 30, 2020
Aug 30, 2020
Dec 14, 2022
Aug 28, 2020
Aug 28, 2020
Aug 28, 2020
Aug 28, 2020

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.