Skip to the content
  1. Docs
  2. Connect your users

Set up Apple Music

Core + Managed TransfersGuide · 2 min
What you need from the Apple Developer portal (Team ID, Key ID, private key, Services ID), the Sign in with Apple return URL, and the Apple Music limits.

What you need from Apple

A paid Apple Developer Program membership, then:

Apple valueWhere you find itMusicAPI field
Team IDdeveloper.apple.com/account, membership detailsTeam ID
Key ID and private key (.p8)Certificates, Identifiers & Profiles → Keys. Create a media identifier and private key.Key ID, Private Key
Services IDIdentifiers → Services IDs. Register a Services ID.Client ID

The key must have both Media Services (MusicKit) and Sign in with Apple turned on. A key without both fails with {"message": "Invalid token specified"}.

Return URL and domains

On the Services ID, configure Sign in with Apple:

  • Domains and subdomains: api.musicapi.com and app.musicapi.com
  • Return URL:
Return URL
https://api.musicapi.com/callback/apple_sign_in

How the Apple sign-in works

The user signs in with Apple, then MusicKit asks for access to their library. MusicAPI signs the developer token with your private key, stores the MusicKit user token, and handles the storefront and the library-versus-catalog ids for you. Apple Music has no OAuth scopes to pick.

Add it to MusicAPI

  1. Open Integrations in the dashboard and pick Apple Music.
  2. Paste the Team ID, the Key ID, the Client ID (Services ID) and the private key, and save.
  3. Turn Is Enabled on.
  4. Press Test Apple Music and sign in once with your own Apple account.

Quirks

Apple's API allows less than most services. With Apple Music you cannot:

  • rename or re-describe a playlist, or delete one;
  • remove or reorder tracks in a playlist, or remove liked tracks;
  • remove a saved album, or follow and unfollow artists.

Creating playlists, adding tracks, liking tracks and saving albums work. The email comes from the Sign in with Apple id token of each sign-in; an account that signed in before has it after its next sign-in. At most 25 items per page (limitParam). Tracks carry an ISRC, and the user search takes one.

Apple Music sign-in
https://app.musicapi.com/{slug}/appleMusic/auth?returnUrl={returnUrl}