Apple Music API

RSS for tag

Apple Music API integrates streaming music with Apple Music content.

Apple Music API Documentation

Posts under Apple Music API tag

98 Posts
Sort by:
Post not yet marked as solved
3 Replies
723 Views
Hey guys, I'm working on an App that plays Apple Music tracks. Therefore I'm using MPMusicPlayerController.applicationMusicPlayer everything is working great so far - including setting the musicPlayer.currentPlaybackRate which is kind of important for my use case. Now I'm trying to setup of the lock screen-controls for my App correctly, especially because using the default ones will reset the currentPlaybackRate to 1.0 after play/pausing. Also I have to sync my internal playState if "pause" is pressed in the lock screen. Here is what I wrote: class AudioPlayerViewModel { ... private let commandCenter = MPRemoteCommandCenter.shared()     init(album: LibraryAlbum? = nil) { ...         self.setupRemoteCommandCenter()     } ... func setupRemoteCommandCenter() {         debugPrint("setupRemoteCommandCenter()")                  commandCenter.previousTrackCommand.isEnabled = false         commandCenter.previousTrackCommand.addTarget { event in             debugPrint("remote previousTrackCommand")             self.previousTrack()             return .success         }         commandCenter.nextTrackCommand.isEnabled = false         commandCenter.nextTrackCommand.addTarget { event in             debugPrint("remote nextTrackCommand")             self.nextTrack()             return .success         }         commandCenter.pauseCommand.isEnabled = false         commandCenter.pauseCommand.addTarget { event in             debugPrint("remote pauseCommand")             self.isPlaying = false             self.pausePlayback()             return .success         }         commandCenter.playCommand.isEnabled = false         commandCenter.playCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in             debugPrint("remote playCommand")             self.isPlaying = true             self.continuePlayback()             return .success         }     } } I call setupRemoteCommandCenter() once(!) before playing anything in MPMusicPlayerController.applicationMusicPlayer My problem is these handlers never get called. The lock screen-controls always remain the default ones. My code has no effect, but also throws no errors. I find several posts about this. The Apple Documentation (https://developer.apple.com/documentation/mediaplayer/handling_external_player_events_notifications) states the this should be possible. What am I doing wrong? Any help would be greatly appreciated.
Posted
by
Post marked as solved
2 Replies
766 Views
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)
Posted
by
Post not yet marked as solved
1 Replies
348 Views
I'm getting an upstream service (500) error when trying to fetch my albums from the Apple Music API. I'm able to get my songs without issue. I tried deleting my albums and re-syncing with the cloud but that didn't seem to fix the issue. Any help would be greatly appreciated. I have the same issue when trying to access my albums via MusicKit. Thank you
Posted
by
Post marked as solved
1 Replies
783 Views
Hey everyone, I am creating playlist via the MusicKit API and by default it creates the playlist in the users library and the isPublic attribute is set to false. Is there a way to make the playlist public at the time of creation? (Only way to change isPublic = true at this time seems to be through the Music app right now)
Posted
by
Post marked as solved
1 Replies
566 Views
Hello, Is there any way to get content like what is displayed in the Browse tab of Apple Music using MusicKit or Apple Music API? I checked the contents of the default recommendations in the Apple Music API, and these were my personal recommendations. Is it possible to get common recommendations?
Posted
by
Post not yet marked as solved
2 Replies
692 Views
https://developer.apple.com/documentation/applemusicapi/get_a_catalog_artist When using Apple Music on iPhone, if you go to the artist detail page, you will see an artist image in the header or a video such as a gif. Alternatively, if you search for an artist on the search page, a circular image is displayed in the imageView on the left. But in the response item of "v1/catalog/{storefront}/artists/{id}" The image could not be found. Why is there no image address in the response? I wish you could add that Thanks :)
Posted
by
Post not yet marked as solved
1 Replies
445 Views
Is the API not working? I created a new developer token and am following documentation but every request I make to the v1 api returns a status code 500 with a basic error message.
Posted
by
Post not yet marked as solved
0 Replies
236 Views
Is it possible that given an artist name, say "AJR", Apple music can return a list of all releases from AJR, including their albums, EP's and singles? I'm considering buying the Apple Music Dev kit but I need to be able to query this for my app idea.
Posted
by
Post not yet marked as solved
0 Replies
187 Views
Hello! I am working on the backend logic to search for Apple Music items (albums primarily, but also songs and artists). We use this API a lot. I was always wondering if there are any best practices about this search API, in particular are there any rules/advices/hints to build the term query parameter to achieve the most accurate results in the response? Thank you!
Posted
by
Post not yet marked as solved
1 Replies
335 Views
Hello! I am updating a songs rating by sending the value of the rating to "https://api.music.apple.com/v1/me/ratings/songs/id". The call succeeds and I get a 200 status code response back. Also when I fetch the rating for the just updated song, the returned data is correct. Just FYI, the app is still in development. Though, when I check the rating in the Apple Music app, the values aren't updated. Only when I switch off the "Sync Library" option in the Settings and turn it back on, the changes are also reflected in Apple Music. On my Mac I have to relaunch the Music app to see the changes. Why does that happen?
Posted
by
Post not yet marked as solved
1 Replies
378 Views
Hello friends, we recently ran into some problems will full dump of EPF feed dated 20211007. I'm wondering if anyone has any suggestions or solutions for these. itunes/collection file The collection file seems to have "lost" its column types? The collection_id column has changed from BIGINT in previous file, to VARCHAR(1000) in latest. Similarly the media_type_id was INTEGER and is also now VARCHAR(1000), and several datetime fields changed to varchar. And even the longer varchar columns for 4000 chars became 1000 chars. For reference the file header is now reporting the following: #export_date collection_id name title_version search_terms parental_advisory_id artist_display_name view_url artwork_url original_release_date itunes_release_date label_studio content_provider_name copyright p_line media_type_id is_compilation collection_type_id #primaryKey:collection_id #dbTypes:BIGINT VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) INTEGER VARCHAR(1000) #exportMode:FULL Comparing with the previous full dump 20210722 #export_date collection_id name title_version search_terms parental_advisory_id artist_display_name view_url artwork_url original_release_date itunes_release_date label_studio content_provider_name copyright p_line media_type_id is_compilation collection_type_id #primaryKey:collection_id #dbTypes:BIGINT BIGINT VARCHAR(1000) VARCHAR(1000) VARCHAR(3000) INTEGER VARCHAR(1000) VARCHAR(1000) VARCHAR(1000) DATETIME DATETIME VARCHAR(1000) VARCHAR(1000) VARCHAR(4000) VARCHAR(4000) INTEGER BOOLEAN INTEGER #exportMode:FULL itunes/artist_collection file This file the columns are still unchanged, so it's a different error. In this case the file contents are not consistent wit the primaryKey constraint in the file. eg. It's reported the pkey is the tuple (artist_id,collection_id,role_id). However, when importing from EPFimporter tool it gives many errors with the latest data because there are duplicate rows. For example the first error I see is for the following entries (which I extracted manually). The problem is the rows are identical except for the "is_primary_artist" value. export_date artist_id collection_id is_primary_artist role_id 1633587189 36270 1461423948 1 1 1633587189 36270 1461423948 0 1 The first error I think I can handle by forcing the column type to be same as before. But the second the data itself has problems so I'm not sure what to do for it. Judging by some of the older posts on this forum I'm not sure there will be any reply, but thanks for looking all the same.
Posted
by
Post not yet marked as solved
2 Replies
851 Views
Hi there, The following code snippet will open Apple Music on an iOS device to a catalog playlist, using the globalId. if let url = URL(string: "music://music.apple.com/us/playlist/\(playlist!.attributes.playParams.globalId!)") {             await UIApplication.shared.open(url) What I'd like to do is open Apple Music using the standard ID, as I don't want to force users to make a playlist public in order to link to it from my app. This requires the above code to use a library link instead of a catalog link. I've tried various permutations of the url, but I can't seem to find the secret sauce. Any tips, would be most appreciated. Thanks!
Posted
by
Post marked as solved
1 Replies
554 Views
Hi there, I don't know if this is possible or not, so I'm asking here. I'd like to know if there is a way to get a list of an Apple Music public playlist via the Apple Music API. I don't think that Music Kit is an option here, as these users would not be Apple Music users, but, again, I'm not sure. The first stumbling block is that I can't seem to figure out how to get an Apple Music users ID or maybe their curator ID, if that's what is needed. Once I had that, I'm still not sure how to get that user's public playlists. Any help on this would be appreciated. Thanks!
Posted
by
Post not yet marked as solved
3 Replies
875 Views
The Apple Music API provides a service to fetch a song via an identifier, as detailed in their documentation in this format: https://api.music.apple.com/v1/catalog/us/songs/900032829 However, I noticed that when linking to a song on Apple Music, the link looks like this: https://music.apple.com/us/album/take-on-me-1985-12-mix-2015-remastered/1035047659?i=1035048414 What I am unable to do (unless without using the Spotify API to look up the IRSC code) is to extract the song ID from the regular music URL. What is the best way to do this?
Posted
by
Post not yet marked as solved
1 Replies
436 Views
Hello i have a question about implementing apple music into my mobile app, is there a way i could have the user sign into apple music api on my app and then it directs them to my exact playlist i want to be played. basically i want someone to be able to listen to apple music on my app but only a certain playlist.
Posted
by
Post not yet marked as solved
0 Replies
369 Views
HI I'm a composer who has used Logic since it ran on an Atari, and was delighted by the update of Logic that includes Dolby mixing particularly as I have been working with sound spatialisation for many years - mostly live, in concerts of music I did at the Royal College of Music in London and around the world - classics of electronic music like Stockhausen and Jonathan Harvey and generally using Max/Ircam software which doesn't always actually work(!). Anyway, I want to create ambient type music which rotates the sounds around the listener, and decoding to binaural and listening on Airpods sounds very good. But. If the head tracking could be employed to keep the image of this 3d soundcape fixed I think (know) the illusion would be so much more pronounced. So is there anyway that this can be incorporated into the listening experience (from the Music app on your phone) - presumably extra data in the file? I'm really not an engineer in that way. Now even more fiddly, and probably a pipe dream, - I'm using the Leslie Cabinet plugin (native to Logic) to create a very lovely sound by spinning the sound of the Tanpura (The Indian Classical stringed drone instrument). What could potentially be mind bending is if the output of the Lesile wasn't just stereo, but actually surround, and that this sound could similarly whirl around the head of the listener, MAINTAINING an fixed reference postiton (is that what I mean?) as the listener moves their head - so the surround leslie output could be directly "inserted" into the space and the Atmos system would, so to speak, know where the rotating drum of the Leslie is at all times. Sometimes though I'm using quite fast rotations - hard to know what the speed is as the knob on the Leslie seems to use arbitrary units (ahem, something more scientific would help!), but max speed sounds like about 30Hz - almost audio itself which creates extaordinary effects. At the moment I'm doing a rough fake by automating a surround panner, and I even tried mapping in a rotary controller, but actually that creates circles within circles, and it can't match the actual experience you might get in a performance of something like Harvey's 4th String Quartet where you're surrounded by actual speakers and the quatrtet is whizzing around you almost sounding like a cloud of bees (last movement -amazing). Thing is we're close, and the listening quality of your products here (the Leslie, the Binaural render and the Airpods themselves) really is exceptional - so much better than stuff I (or other people) have made in say Max or Ableton Live. I'm very impressed so far but I feel we could push it to "the next level" as you Americans say. I hope that explains the sort of thing I would like to work with? I'm sure it's very niche, and feel free to tell me to piss off, lol, but your ads always claim that you're really into making cool stuff. This is cool (says the 55yo balding guy). I really think this way of listening with Aipods is going to become massive - I'm no gamer, but the implications for the immersive sound on those (and for watching films) is huge too (I'm sure you have someone working on it) I'm just a composer writing profoundly uncommercial, rather poetic, classical electronic music ;). I've attached a rough BInaural mix of this thing I'm working on with the Tanpuras, Temple bells and some improvising musicians i know - once you hear the sound I think it will become much more clear what I'm talking about - and hopefully you like the music and not just effect! Very unfinished, and very hot off the press, so to speak. I've also added a screen grab of my current workaround in Logic and a cool picture of Stockhausen making it work in !959 (!) before we ever dreamed of having tiny computers in our ears. If you can't help I may have to actually build a version of that spinning table, which would be a pain and expensive - I've spent more than enough on your products over the years. ;) https://www.dropbox.com/s/uh9a4nx7psiv9qb/Tanpura%20Extended%20with%20Hannah%20Dolby%20Atmos%20Version%20%28A%29.mp3?dl=0 Ok it won't let me submit the pic, ugh... Thanks for taking the time, let me know what you think, cheers, Michael Oliva
Posted
by
Post not yet marked as solved
0 Replies
253 Views
How do we use MusicKit to search for the new Siri playlists for mood etc? I understand that Voice subscribers can't search for songs using API searches - I'm asking a question in the opposite direction. If full subscribers know the names of the new playlists they can access and play them - are there searches that will surface them? Thank you Daniel
Posted
by
Post not yet marked as solved
1 Replies
402 Views
Hi! We are sometimes logging this error when requesting an Apple Music API endpoint with a good access token: "{"errors":[{"id":"XXXXX","title":"Insufficient Privileges","detail":"User does not have access to privilege: CloudLibrary","status":"400","code":"40015"}]}" Any idea why this error is returned for a user?
Posted
by