An Apple Music API wrapper.
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.stevesoltys:apple-music:0.1.0'
}
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!!)
// ...
This library is available as open source under the terms of the MIT License.