Post not yet marked as solved
Hello.
The Apple Music API has a dedicated endpoint for the user's personal station. I am wondering if the other "For You" stations, such as the "Favorites Mix" and the "New Music Mix" are available? Even if not through a dedicated endpoint, but through searching for them?
Thanks.
Edit: also the "[Artist] & Similar Artists Station" stations, for that matter.
Post not yet marked as solved
Hi there!
I know that this is not related to MusicKit but Apple Music API, but I am curious to know where to find the activities to use this identifier?
Get a Catalog Activity endpoint:
https://api.music.apple.com/v1/catalog/{storefront}/activities/{id}
If I use the example ID given on the page, I get "Resource Not Found" error.
So, where do I get the activities ID?
Post not yet marked as solved
https://developer.apple.com/documentation/applemusicapi/add_tracks_to_a_library_playlist
I use this api with python,
post data:
https://api.music.apple.com/v1/me/library/playlists/{id}/tracks
{'tracks': {'data': [{'id': '310730206', 'type': 'songs'}, {'id': '310730208', 'type': 'songs'}]}}
error:
'Unable to parse request body'
Post not yet marked as solved
Hi,
We have an app which is a music social network, it worked fine on both Spotify/Apple Music up until the last few days, now the Apple Music search function is not working at all.
Just wondering have we missed something has changed or any idea why it would be returning null. See image.
We've tried other apps that use Apple Music and they seem fine, but nothing has changed on our app. So we know the API is working. We're puzzled.
Does anyone have any idea, would be massively appreciated.
Post not yet marked as solved
I am able to retrieve a playlist via the API by its ID but how do I retrieve it by the playlist’s name/title? I’m hoping to avoid getting all playlists in a library and searching from there.
Post not yet marked as solved
Hello,
I just submitted FB9939377 about this issue, but figured I'd still post on the forums as well.
I have been working on bringing song and album rating functionality to my app, using MusicDataRequest from MusicKit for Swift.
When I like or dislike a song, or delete the existing rating, those changes are reflected immediately in the Music app across all of my devices.
However, when I try to rate or delete an existing rating for an album, the API request is successful, but the changes are not reflected in Music.app on any of my devices. Querying the /v1/me/ratings/albums/[id] endpoint correctly shows the change that was made, but it does not seem to sync the change to any devices, which continue to show whatever the rating state was before the change I made in my app.
I ran 3 tests on albums with the following IDs:
1485040020 - Disliked -> Loved
Disliked in Music.app
/v1/me/ratings/albums/1485040020 shows the value of the rating attribute as “-1”
Changed to “Loved” in my app
/v1/me/ratings/albums/1485040020 confirms the value of the rating attribute has changed from “-1” to “1”
Music.app on the iPod I used to make the change in my app, as well as another iPhone 11 signed into that Apple ID show the original “Disliked” rating for the album.
1485042017 - Loved -> No Rating
Liked in Music.app
/v1/me/ratings/albums/1485042017 shows the value of the rating attribute as “1”
Deleted the rating from my app
/v1/me/ratings/albums/1485042017 now 404s, indicating there is no rating for this album.
Music.app on the iPod I used to make the change in my app, as well as another iPhone 11 signed into that Apple ID show the original “Loved” rating for the album.
1485037658 - No Rating -> Loved
Confirmed /v1/me/ratings/albums/1485037658 returns a 404, as there is no rating for this album
“Loved” the album in my app
/v1/me/ratings/albums/1485037658 now returns a value of “1”
Music.app on the iPod I used to make the change in my app, as well as another iPhone 11 signed into that Apple ID show me the option to either “Love” or “Suggest Less Like This,” indicating there is no existing rating for the album.
There are sysdiagnoses attached to the feedback. Please let me know here or in the Feedback if there is any more information I can provide. Thanks!
(P.S., I'm requiring iOS 15 for the next version of my app, so I've finally been digging into MusicKit. What a well-designed and useful API! It's been so quick and easy to replace most of my existing URLSession data task code with MusicKit, and MusicDataRequest is such a thoughtful inclusion to be able to interface with the elements of the API not natively in MusicKit, with the added benefit of not needing to deal with tokens anymore. Thanks to the team for all of their continued hard work on it.)
Post not yet marked as solved
Hi there!
I wanted to know, if anyone can answer me ..
if I had to implement a WebView as an app (then insert the website) + some native function, how many possibilities are there for it to be accepted by apple and published on the App Store?
Post not yet marked as solved
I'm working on an app that communicates with the Apple Music API. I'm attempting to run the app on a simulator (ios 14.2). When I run this code:
SKCloudServiceController().requestUserToken(forDeveloperToken: developerToken) { (receivedToken, error) in
print(receivedToken ?? "No Token")
print(error)
guard error == nil else { return }
// the rest of the code that never gets called ...
}
It prints this error:
Error Domain=SKErrorDomain Code=9 "The latest Apple privacy policy has yet to be acknowledged" UserInfo={NSLocalizedDescription=The latest Apple privacy policy has yet to be acknowledged}
And obviously I get no user token.
How do I Acknowledge the latest Apple privacy policy?
I am signed in with my apple Id in my simulator. I can use apple music on my regular iPhone and I can use Apple Music on OS X without Apple asking me to acknowledge Privacy Policy. Is there some way of provisioning user data on the app for testing purposes?
Post not yet marked as solved
A while ago I started developing a hobby web app aroune Apple Music, and I created a script to generate my JWT and I used it with MusicKit and with Apple Music API and everything was working perfectly fine, and now I came back and wanted to continue the project from where I left off and I tried using the same code (I literally ran the same script without changing anything, it already had the p8 file and the team ID and app key etc..) so I generated a new JWT with that script, and for the Apple Music API it's working as it should, but for the MusicKit (only tried for web) it seems to not work.
For some reason when I try to authorize the user (w/ MusicKit for web) it does open the authorization pop up window and after the user enters their Apple Music credentials and tries to login, the pop up windows says there's an error, and in the URL I can see an "error" query param with the value "ERROR_FAILED_TO_VERIFY_JWT" (but the JWT is clearly working fine with Apple Music API...)
I already opened an issue report on the feedback assistant, but I was thinking maybe someone has/had the same problem and knows how to solve it or what causes it :)
Post not yet marked as solved
Hello,
I'm using systemMusicPlayer to play Apple Music Live Radio Station got from Apple Music API. But it doesn't work. How can I do that?
Error:
Test[46751:13235249] [SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=6 "Failed to prepare to play" UserInfo={NSDebugDescription=Failed to prepare to play}
My implementation:
let musicPlayerController = MPMusicPlayerController.systemMusicPlayer
musicPlayerController.beginGeneratingPlaybackNotifications()
musicPlayerController.setQueue(with: "ra.978194965")
musicPlayerController.play()
API response:
{
“id”: “ra.978194965”,
“type”: “stations”,
“href”: “/v1/catalog/us/stations/ra.978194965”,
“attributes”: {
“artwork”: {
“width”: 4320,
“url”: “https://is2-ssl.mzstatic.com/image/thumb/Features114/v4/e5/10/76/e5107683-9e51-ebc5-3901-d8fbd65f2c2a/source/{w}x{h}sr.jpeg”,
“height”: 1080,
“textColor3”: “332628”,
“textColor2”: “120509”,
“textColor4”: “33272a”,
“textColor1”: “000000”,
“bgColor”: “f4f4f4”,
“hasP3”: false
},
“url”: “https://music.apple.com/us/station/apple-music-1/ra.978194965”,
“mediaKind”: “audio”,
“supportedDrms”: [
“fairplay”,
“playready”,
“widevine”
],
“requiresSubscription”: false,
“name”: “Apple Music 1”,
“kind”: “streaming”,
“radioUrl”: “itsradio://music.apple.com/us/station/ra.978194965”,
“playParams”: {
“id”: “ra.978194965”,
“kind”: “radioStation”,
“format”: “stream”,
“stationHash”: “CgkIBRoFlaS40gMQBA”,
“mediaType”: 0
},
“editorialNotes”: {
“name”: “Apple Music 1”,
“short”: “The new music that matters.”,
“tagline”: “The new music that matters.”
},
“isLive”: true
}
},```
Thank you!
Best regards,
MichaelNg
Hi There,
In the documentation of MusicKit's Song object I can find the hasLyrics property, with the following description:
A Boolean value that indicates whether the song has lyrics available in the catalog. If true, the song has lyrics available; otherwise, it doesn’t.
My only question now is, where can I find the lyrics if this returns true? What is "the catalog" in this case.
I hope the lyrics are available in MusicKit or the Apple Music API as this would save me a lot of headache connecting more API's (lyrics is one of my most requested feature)
Hello,
I have an app that uses the MediaPlayer framework (applicationQueuePlayer specifically) and since the introduction of iOS 14.6 and Lossless audio, some users have been reporting that sometimes they cannot play a song past 15 seconds without playback either pausing or the app making a screeching noise. As far as I knew, this was supposed to be fixed in 14.7, but users running 14.7.1 are reporting it to me whether Lossless is on or off. The problem seems to be intermittent -- there for one user one day and gone the next, though sometimes it sticks around. I am pretty much never able to reproduce it for myself.
My code to load and play the player is pretty simple and has not changed since well before this issue started cropping up. I run setQueue and set the queue with either a descriptor of storeIDs for Apple Music Items or an MPMediaItemCollection for library items, then call Play.
Is there anything I can do about this issue? Are you guys still working on this server side? I need to continue supporting users on older OSes so I am not yet able to use the new MusicKit for Swift player. I don't know if it's fixed there or not.
Thanks! (Tagging in @JoeKun)
For my app that heavily uses both ShazamKit and MusicKit, I need to be able to check if the matched song is in the user's library or not.
I couldn't find an easy way to do this with MusicKit so I first then turned to the Apple Music API as they introduced the new parameter
?relate=library during this year's WWDC.
When I first tried it, it worked as expected, and was very happy to have gotten it to work. However, it stopped working lately and now I turned to use MPMediaLibrary as that still works but is a lot slower in performance.
Anyone has any idea why the ?relate=library stopped working for me or know a better way to check if the Song exists in the user's library?
func checkInLibrary(from appleMusicID: String) async {
do {
let countryCode = try await MusicDataRequest.currentCountryCode
let libURL = URL(string: "https://api.music.apple.com/v1/catalog/\(countryCode)/songs/\(appleMusicID)?relate=library")!
let request = MusicDataRequest(urlRequest: URLRequest(url: libURL))
let dataResponse = try await request.response()
print(dataResponse.debugDescription)
}
catch { // I'm handling errors here }}
Post not yet marked as solved
Working with MusicKitJS V3, and with the extend key being used, I'm trying to request the animated editorialVideo in my app.
this.musicKitInstance.api.music(
`v1/catalog/${this.musicKitInstance.storefrontId}/albums/${id}`,
{
extend: 'artistUrl,composerUrl,trackCount,editorialVideo,editorialArtwork',
}
)
Looking at how music.apple.com does it, this appears to be the correct format, but the API never returns the editorialVideo in the response. Which stands out as the API will return the artistUrl in the response, just not the editorialVideo.
Is this a limitation of the API?
Post not yet marked as solved
Hi,
I've been asked to develop a software for macOS that monitors daily 24/7 some streamings and logs the aired music.
I'd like to use ShazamKit, by the way I don't know if I have to do something in particular in order to use it in a commercial app and I don't know if with so many requests I can hit some threshold (it could be 10 simultaneous streams, it could be 100 simultaneous streams, I don't know at the moment).
Any info about that?
Post not yet marked as solved
Hi,
I'm looking at using some of the following endpoints:
https://developer.apple.com/documentation/applemusicapi/search_for_catalog_resources
https://developer.apple.com/documentation/applemusicapi/get_a_catalog_album
https://developer.apple.com/documentation/applemusicapi/get_a_catalog_artist
My questions are:
What is the rate-limiting on these endpoints?
Is it rate limiting applied by IP address or by API key? In other words, can I use these endpoints to scale or is there a maximum by app?
Does each endpoint share the same rate-limiting or are their different rate-limits per endpoint. If so, what are the differences?
Post not yet marked as solved
Hi, question in the title.
I can't find docs on the API usage. I would like to know if I can build an Apple music clone integrating other streaming sources (Spotify forbids this for example).
Thanks for your help!
Post not yet marked as solved
I'm getting a variety of errors when I call prepareToPlay on the MPMusicPlayerController. Sometimes they happen, sometimes they don't. I'm trying to play songs from the Apple Music service. When I don't get the errors, it plays just fine. I have iOS v13.5.1 on my iPhone Xs and I'm using Xcode 11.5. This is my code:
let applicationMusicPlayer = MPMusicPlayerController.applicationMusicPlayer
applicationMusicPlayer.setQueue(with: [trackID])
applicationMusicPlayer.prepareToPlay(completionHandler:{ error in
if let error = error {
print(error.localizedDescription)
return
}
DispatchQueue.main.async{
applicationMusicPlayer.play()
}
}
These are the various errors I'm getting:
[SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=2 "Queue was interrupted by another queue" UserInfo={NSDebugDescription=Queue was interrupted by another queue}
[SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=9 "Preparing queue timed out" UserInfo={NSDebugDescription=Preparing queue timed out}
[SDKPlayback] Failed to prepareToPlay error: Error Domain=MPMusicPlayerControllerErrorDomain Code=6 "Failed to prepare to play" UserInfo={NSDebugDescription=Failed to prepare to play}
[SDKPlayback] applicationQueuePlayer _establishConnectionIfNeeded timeout [ping did not pong]
Post not yet marked as solved
Help me!!
I'm getting a variety of errors when I call prepareToPlay on the MPMusicPlayerController. Sometimes they happen, sometimes they don't. I'm trying to play songs from the Apple Music service. When I don't get the errors, it plays just fine. I have iOS v15.0.2 on my iPhone Xs and I'm using Xcode 13.2. This is my code:
Xcode Command tool result output:
error is Error Domain=MPMusicPlayerControllerErrorDomain Code=2 "Queue was interrupted by another queue" UserInfo={NSDebugDescription=Queue was interrupted by another queue}
Post not yet marked as solved
Hello,
I need to rearrange the tracks of my playlist by using Apple Music APIs. Is that possible?
Hope that I can get help.