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

81 Posts
Sort by:
Post not yet marked as solved
0 Replies
389 Views
I'm currently working on integrating MusicKit into my app and would like to provide a seamless user experience by displaying only the songs that are available in the user's region or country. However, after going through the MusicKit documentation, I couldn't find a direct method to determine song availability based on the user's location. I wanted to inquire if there is a way to determine if a specific song or a catalog of songs is available in the user's region or country using MusicKit. It would be incredibly helpful if someone could guide me on how to achieve this or provide any insights on alternative approaches. Thank you in advance for your assistance!
Posted
by
Post not yet marked as solved
0 Replies
711 Views
Hi everyone. I am creating a ReactNative application which requires user's data from his/her apple music account. In order to retrieve user's apple music data, I understand that I need both a developer token and a user's access token with the appropriate scope for Apple Music. https://developer.apple.com/documentation/applemusicapi/user_authentication_for_musickit I had created developer token and tested it, suggested by documentation https://developer.apple.com/documentation/applemusicapi/generating_developer_tokens For user's login, I am creating login URL with the npm package apple-auth and configuration object is export const con: any = { client_id: clientId, team_id: teamId, key_id: keyId, redirect_uri: "https://api.borrow4less.ca/api/v1/welcome", scope: "email", }; I registered a service identifier for domain/subdomain and returnURL. when I go the login url it shows login url is :https://appleid.apple.com/auth/authorize?response_type=code%20id_token&client_id=com.QueueMusic&redirect_uri=https://api.borrow4less.ca/api/v1/welcome&state=489612589c&scope=email&response_mode=form_post Invalid client id or web redirect url. I would greatly appreciate any guidance or insights from the community regarding the correct configuration object to use with "apple-auth" or any alternative. Regards
Posted
by
Post not yet marked as solved
0 Replies
595 Views
Hello. I'm Korean, and the system language of macOS is in English because user directories such as Desktop and Document should be displayed in English. As I use the system language in English, the singers and song names of the Korean songs of Apple Music are also displayed in English. It is so confused to find the song in the App, or to talk about the song with other people. I'm using Apple Music with my Korean account, and I'm also using the region of the system in Korea. There is a function to customize language settings for the specific applications, so I tried to change the language setting of the Music App (specific app) to Korean. In this case, Music Apps are displayed in Korean. But the song information (singer, title) and various playlists are still displayed in English. Many Korean users are suffered with this problem, so I think there should be some ways to see the information of Korean music sources in Korean in the Music App preferences, other than changing the system language of macOS and iOS.
Posted
by
Post not yet marked as solved
0 Replies
534 Views
If a user has only added one song from an album in its library, the library album endpoint (/me/library/albums) will return this album. It does not make sense because the user did not add the full album to its library, only one song. Note that the Apple Music app is doing the same in its Library > Albums section. How to retrieve only those albums which have been added ?
Posted
by
Post not yet marked as solved
0 Replies
423 Views
Is there any way to make an API call that would add an artist to a user's favorites, like this article outlines? https://support.apple.com/guide/music/select-artists-as-favorites-musf33a29ebf/mac I know I am able to add individual resources (song, album, playlists) to user libraries but I specifically want to add a favorite artist. Thank you in advance to anybody with thoughts.
Posted
by
Post not yet marked as solved
0 Replies
415 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
340 Views
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?
Posted
by
Post marked as solved
1 Replies
516 Views
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!
Posted
by
Post not yet marked as solved
0 Replies
458 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
385 Views
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.
Posted
by
Post marked as solved
1 Replies
486 Views
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!
Posted
by
Post not yet marked as solved
0 Replies
386 Views
Hello! I'd like to understand if I can use snippets from songs, such as just the choruses or other parts, like previews for my commercial application, similar to how it's done on TikTok. Can I use them alongside other content? If it's a paid service, how can I find out the cost of such usage?
Posted
by
Post not yet marked as solved
0 Replies
407 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
360 Views
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? 😅
Posted
by
Post not yet marked as solved
0 Replies
503 Views
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>
Posted
by
Post not yet marked as solved
2 Replies
394 Views
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.
Posted
by