Apple Music API

RSS for tag

Apple Music API integrates streaming music with Apple Music content.

Posts under Apple Music API tag

81 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Apple Music API Extended Features - UPDATE/DELETE
Trying to use the Apple Music API for mirroring playlists from spotify. Wondering if it will ever be on the roadmap to update/reorder playlists, or delete playlists/remove items using the API? Is this something that can't be handled or is it a business decision? I see that there is more flexibility with the MusicKit. Can we expect something like this in the future for the API? Thanks,
0
0
459
Dec ’23
Classical Music App metadata using API
Hi, I'm a newbie here. I've signed up for the developer program hoping to retrieve extended metadata for the Classical music that is avaliable in Classical app. For example, each performer is assigned an instrument or voice. Unfortunately, the test API call did not return extended metadata, just regular metadata from Music App or page. Does anybody knows if there are plans to make this extended metadata available thru API ?
0
0
300
Nov ’23
Request for Free Access to the Apple Music API and Apple Link Shortener for Affiliate Links
Dear Apple devs, I hope this message finds you well. I am writing to seek your guidance and assistance in a matter related to my blog, which features affiliate links to the Apple Music store. Currently, I manage all aspects of my blog independently. However, I find myself facing the formidable task of updating 300 articles, and I am exploring options to streamline and automate this process. To achieve this automation, I am looking into the creation of affiliate links through the Apple Music API and the affiliate program. While this approach promises efficiency and enhanced user experience, I must acknowledge a financial constraint. Acquiring a developer account, a prerequisite for API access, involves a cost of €99, which presents a challenge within my budgetary constraints. I have come across information suggesting the possibility of requesting a fee waiver, yet the process entails an initial payment with no guarantees. This leads me to seek your advice on the most viable and cost-effective solution to address this predicament. Your insights and recommendations would be greatly appreciated, as they will guide my decision on the best course of action moving forward. I am committed to upholding the integrity of my blog and ensuring its continued success, and your expertise will be instrumental in achieving this goal. Thank you in advance for your time and assistance. I eagerly await your response and look forward to resolving this matter with your support.
0
0
492
Nov ’23
iOS 17.1 Features (Credits, Favorite Artist & Playlist Covers)
Hey there, There was so many awesome new changes introduced in iOS 17.1, and we would love to leverage them via the API! Namely: A new endpoint that returns the credits of a song. A way to add an artist to the library of a user. A way to update the cover of a playlist. All these three features are amazing - please let us know if you plan to add them to the API! All the best, Oskar
0
0
297
Nov ’23
Beginner trying to authorize Apple Music API request
I'm a new programmer and I'm trying to work with the Apple Music API as a way to teach myself. So this is probably a dumb question, but I'm using the docs to figure out how to make a request, and I think I have the token all set with the key ID and UNIX time and all that. But I get a 401 Unauthorized back when I send a GET request with it, and I'm having trouble understanding what the docs say about authorization. It says to pass Authorization: Bearer in the header. I'm trying to do that in Insomnia but it must be over my head. I'm guessing there's something obvious that I'm doing wrong, but I'm not sure what. Hoping someone here will take one look at it and be able to tell me. I tried it a few different ways but this is the gist.
2
0
423
Oct ’23
Share Extension - App no longer showing after Xcode/IOS Update
I recently updated to Xcode 15 and IOS 17 and now my Share Extension is no longer appearing. The share extension is meant to take the URL from a song when a user selects share in Apple Music. It was working perfectly before the update, so I'm wondering if I missed something that would cause this error or if this is happening or has happened to anyone else. If so, what's the best way to fix it? Here's my Activation Rule for reference: <dict> <key>NSExtension</key> <dict> <key>NSExtensionAttributes</key> <dict> <key>NSExtensionActivationRule</key> <dict> <key>NSExtensionActivationSupportsWebURLWithMaxCount</key> <integer>1</integer> </dict> </dict> <key>NSExtensionMainStoryboard</key> <string>MainInterface</string> <key>NSExtensionPointIdentifier</key> <string>com.apple.share-services</string> </dict> </dict>
0
0
554
Oct ’23
Music app on my iPad not working as intended
Hi! I have a 4th gen iPad Air with 17.1 beta 1 version loaded on it. When trying to edit a playlist, every time I remove a song, it always goes back to the top of my playlist, causing me to have to scroll back down. But that’s not the only problem; once I do get back to where I was in my list, and before I can do anything else it will just go back to the top of my list without me doing anything! it doesn’t happen every time but enough times to make it hard for me to continue what I’m trying to do. I have closed the app several times, and even restarted my iPad a few times but still the issues persist! Help? 😅
0
0
384
Oct ’23
Response data for playlists and songs in Apple Music API
I was thinking about paying to join the Apple Developer program for access to the Apple Music API, and making an app just for practice in improving my skills. I was looking at the sample response data in the documentation online, and noticed there's some stuff missing that I would want to use. Mainly what songs are in a playlist (it looks like you get that info for a catalog playlist but not a library playlist, which seems backwards but maybe I'm confused about what those mean), and information about particular songs in a user's library like number of plays, date last played, etc. Basically I thought you'd get access to anything you can see in the Apple Music Player on the desktop version. It seems like that's obviously not true but I was surprised, so I thought I'd ask to see if anyone who has used the API can tell me for sure. Probably don't want to pay if you don't get access to all the data I was thinking about.
0
0
441
Sep ’23
MusicDataRequest responding with an Internal Service Error when creating a playlist folder
I am trying to create a new playlist folder in Apple Music using MusicKit on iOS 16. However, I am receiving an Internal Service Error when sending the request. This is the code: let urlString = "https://api.music.apple.com/v1/me/library/playlist-folders" let url = URL(string: urlString)! let body = LibraryPlaylistFolderCreationRequest( attributes: .init( name: "test-playlist-folder"), relationships: .init( parent: .init( data: [.init(id: "playlistsroot", type: "library-playlist-folders")]))) var urlRequest = URLRequest(url: url) urlRequest.httpMethod = "POST" urlRequest.httpBody = try JSONEncoder().encode(body) let request = MusicDataRequest(urlRequest: urlRequest) let response = try await request.response() let responseString = String(data: response.data, encoding: .utf8) print(responseString) When I print the request body using the following code snippet, I get the output as seen below: let jsonBody = try JSONEncoder().encode(body) print(String(data: jsonBody, encoding: .utf8)) Output of the above snippet: Optional("{\"attributes\":{\"name\":\"test-playlist-folder\"},\"relationships\":{\"parent\":{\"data\":[{\"id\":\"playlistsroot\",\"type\":\"library-playlist-folders\"}]}}}") Which should conform to the JSON scheme provided in the docs: https://developer.apple.com/documentation/applemusicapi/libraryplaylistfoldercreationrequest And this is the error output: [DataRequesting] Failed to perform MusicDataRequest.Context( url: "https://api.music.apple.com/v1/me/library/playlist-folders", currentRetryCounts: [.other: 1] ) with MusicDataRequest.Error( status: 500, code: 50000, title: "Internal Service Error", detailText: "", id: "VK23VIZ6AAM5IVP4GIFQ6VXPLU", originalResponse: MusicDataResponse( data: 111 bytes, urlResponse: <NSHTTPURLResponse: 0x000000028042b0c0> ) ). After a lot of trial and error, I don't think I know what the underlying issue is. Is MusicDataRequest not designed to issue POST requests? Is it something else? Kind regards!
1
0
526
Sep ’23
Apple Music API - Add Tracks to beginning of Library Playlist
We are using the following endpoint to add songs to a user's library playlist: https://developer.apple.com/documentation/applemusicapi/add_tracks_to_a_library_playlist However, it looks like it is currently only possible to add tracks to the end of a playlist, and there is no way of re-ordering the tracks either. It would be great if we were able to pass an index of the position where the object should be added within the playlist, or if that's too complicated, then at least have a param that allows to add tracks to the beginning of the playlist. Adding new tracks at the end of a playlists that already has a lot of songs just isn't effective as they won't be discovered.
0
0
412
Aug ’23
Fetch with time in Apple music API
I'm trying to pull library songs, playlist and artist from authorized user. The API gives me data in alphabetical order and there's no timestamp in the response, is it possible to fetch data with the most recent ones first? It is very difficult to pull all the data and filter ourselves, is it possible to fetch only the first 30-60 most recent ones?
0
0
488
Aug ’23
MusicKit MusicCatalogSearchRequest.response() starting failing with 401 userTokenRequestFailed for users without subscription
Hello, I have an app published on AppStore which relies on MusicKit's functionality to retrieve results of MusicCatalogSearchRequest even when a user doesn't have an Apple Music subscription. (As per other sources and this thread, this is expected to work normally for users without the subscription.) The app used to work fine for months, yet today all the devices I tested on failed to execute the request (both AppStore and dev versions), resulting in the following log: 2023-07-27 23:45:16.036271+0200 Lisyn[6288:3156868] [DataRequesting] Updated user token cache with new error. 2023-07-27 23:45:16.043294+0200 Lisyn[6288:3156868] [DataRequesting] Failed retrieving user token: Error Domain=ICError Code=-8101 "Failed to fetch music user token with Unauthorized (401) status code. Account does not have an active Apple Music Subscription." UserInfo={NSDebugDescription=Failed to fetch music user token with Unauthorized (401) status code. Account does not have an active Apple Music Subscription.}. Throwing .userTokenRequestFailed. 2023-07-27 23:45:16.043413+0200 Lisyn[6288:3156868] [DataRequesting] Failed refreshing user token for MusicDataRequest.Context( url: "https://api.music.apple.com/v1/catalog/it/search?term=B&l=en-GB&types=songs&limit=25&omit%5Bresource%5D=autos", currentRetryCounts: [.userTokenInvalid: 1], activeRetryContext: RetryContext( reason: .userTokenInvalid, previousTokens: .personalizedTokens( developerToken: "some token", userToken: "some other token" ) ) ). Error = .userTokenRequestFailed. I am using automatic token generation and make requests via MusicKit: func searchMusic(searchText: String) async throws -> [PlaybackStoreID] { return try await throttler.schedule { var request = MusicCatalogSearchRequest(term: searchText, types: [Song.self]) request.limit = 25 return try await request.response().songs.map(\.id.rawValue) } } None of the certificate/identifier settings, nor the code related to the issue has been touched between when it was working and now. Also, live versions stopped working as well, so I am sure this isn't related. Is this a temporary issue? Should I roll out a fix using non-automatic token generation? Thank you!
1
0
569
Jul ’23
Apple Music not showing up
I have two apple ID's. On my iPhone (16.x) I have Apple Music on with no issues. On the beta I am not given a choice of adding another Apple ID for Apple Music. In Settings go to Apple ID and tap on Subscriptions. I only see the current Apple ID using the OS-17 beta release Has anyone seen this?
0
0
352
Jul ’23
Is it possible to have Music on the app not from Itunes or the Music Kit?
Planning to create a Music Game App similar to Guitar Hero kind of, and I am planning to use songs from beginner producers (They don't have any Publishers or Distributors). If I get their legal concent through a contract to use their songs, does Apple allow to have Music that is not from Itunes if I get the legal license from the producer to use their songs in my app? Will apple allow songs that don't have Publishers or Distributors, or in the App review stage they will flag it and cause an issue for me?
0
0
448
Jul ’23